(1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.5ms) BEGIN Account Load (1.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-02-11 12:32:51.057610"], ["updated_at", "2019-02-11 12:32:51.057610"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-02-11 12:32:51.062274"], ["synced_id", 0], ["id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.081926"], ["updated_at", "2019-02-11 12:32:51.081926"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-11 12:32:51.093432"], ["updated_at", "2019-02-11 12:32:51.093432"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.103802"], ["updated_at", "2019-02-11 12:32:51.103802"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-11 12:32:51.111308"], ["updated_at", "2019-02-11 12:32:51.111308"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.121366"], ["updated_at", "2019-02-11 12:32:51.121366"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-11 12:32:51.129155"], ["updated_at", "2019-02-11 12:32:51.129155"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.138340"], ["updated_at", "2019-02-11 12:32:51.138340"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-11 12:32:51.147753"], ["updated_at", "2019-02-11 12:32:51.147753"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.161486"], ["updated_at", "2019-02-11 12:32:51.161486"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.168208"], ["updated_at", "2019-02-11 12:32:51.168208"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 11], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-11 12:32:51.178102"], ["id", 11]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.189984"], ["updated_at", "2019-02-11 12:32:51.189984"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.196296"], ["updated_at", "2019-02-11 12:32:51.196296"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 13], ["LIMIT", 1]] Account Update (2.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-11 12:32:51.204239"], ["id", 13]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 13], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.219034"], ["updated_at", "2019-02-11 12:32:51.219034"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-11 12:32:51.227073"], ["updated_at", "2019-02-11 12:32:51.227073"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 15], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-11 12:32:51.236274"], ["id", 15]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 15], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-02-11 12:32:51.251741"], ["updated_at", "2019-02-11 12:32:51.251741"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1549974771"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.7ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-02-11 12:32:51.262484"], ["updated_at", "2019-02-11 12:32:51.262484"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1549801971"]]  (2.0ms) COMMIT  (2.2ms) BEGIN Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 17], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-02-11 12:32:51.283098"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1550061171"], ["id", 17]]  (2.4ms) COMMIT Account Load (1.6ms) SELECT "accounts".* FROM "accounts"  (1.1ms) BEGIN Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 17]]  (1.8ms) COMMIT  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-02-11 12:32:51.299641"], ["updated_at", "2019-02-11 12:32:51.299641"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 18], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-02-11 12:32:51.303685"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 18]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-11 12:32:51.335200"], ["updated_at", "2019-02-11 12:32:51.335200"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.5ms)  (1.4ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-11 12:32:51.354417"], ["updated_at", "2019-02-11 12:32:51.354417"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.9ms)  (2.2ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-11 12:32:51.373241"], ["updated_at", "2019-02-11 12:32:51.373241"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 8.4ms)  (1.1ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 6.5ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.9ms) BEGIN  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (2.4ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (1.4ms) BEGIN  (1.5ms) ROLLBACK  (1.5ms) BEGIN  (2.0ms) ROLLBACK  (1.8ms) BEGIN  (1.7ms) ROLLBACK  (1.3ms) BEGIN Account Load (2.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-02-14 03:31:08.580145"], ["updated_at", "2019-02-14 03:31:08.580145"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-02-14 03:31:08.585560"], ["synced_id", 0], ["id", 22]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.606802"], ["updated_at", "2019-02-14 03:31:08.606802"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.616294"], ["updated_at", "2019-02-14 03:31:08.616294"], ["provider", "bookingsync"], ["synced_id", 123]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 24], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-14 03:31:08.631173"], ["id", 24]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.643948"], ["updated_at", "2019-02-14 03:31:08.643948"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.649499"], ["updated_at", "2019-02-14 03:31:08.649499"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 26], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-14 03:31:08.656274"], ["id", 26]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 26], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.667332"], ["updated_at", "2019-02-14 03:31:08.667332"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.671993"], ["updated_at", "2019-02-14 03:31:08.671993"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 28], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-14 03:31:08.681231"], ["id", 28]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 28], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.695069"], ["updated_at", "2019-02-14 03:31:08.695069"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SELECT COUNT(*) FROM "accounts" Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 03:31:08.713230"], ["updated_at", "2019-02-14 03:31:08.713230"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (1.0ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.728422"], ["updated_at", "2019-02-14 03:31:08.728422"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.7ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 03:31:08.740221"], ["updated_at", "2019-02-14 03:31:08.740221"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.751832"], ["updated_at", "2019-02-14 03:31:08.751832"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 03:31:08.761276"], ["updated_at", "2019-02-14 03:31:08.761276"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 03:31:08.772716"], ["updated_at", "2019-02-14 03:31:08.772716"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 03:31:08.780109"], ["updated_at", "2019-02-14 03:31:08.780109"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-02-14 03:31:08.794323"], ["updated_at", "2019-02-14 03:31:08.794323"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1550201468"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-02-14 03:31:08.804878"], ["updated_at", "2019-02-14 03:31:08.804878"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1550028668"]]  (2.0ms) COMMIT  (2.0ms) BEGIN Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 38], ["LIMIT", 1]] Account Update (1.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-02-14 03:31:08.825407"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1550287868"], ["id", 38]]  (1.6ms) COMMIT Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.7ms) BEGIN Account Destroy (0.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 38]]  (1.4ms) COMMIT  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-02-14 03:31:08.839551"], ["updated_at", "2019-02-14 03:31:08.839551"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 39], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-02-14 03:31:08.845167"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 39]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 39], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 03:31:08.931328"], ["updated_at", "2019-02-14 03:31:08.931328"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.2ms)  (1.0ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 03:31:08.946591"], ["updated_at", "2019-02-14 03:31:08.946591"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 03:31:08.960299"], ["updated_at", "2019-02-14 03:31:08.960299"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 5.4ms)  (0.8ms) ROLLBACK  (2.3ms) BEGIN  (1.7ms) ROLLBACK  (1.7ms) BEGIN  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 13ms (Views: 8.6ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 06:46:12.138147"], ["updated_at", "2019-02-14 06:46:12.138147"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 51ms (ActiveRecord: 18.8ms)  (2.0ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 06:46:12.157881"], ["updated_at", "2019-02-14 06:46:12.157881"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.6ms)  (1.3ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 06:46:12.176197"], ["updated_at", "2019-02-14 06:46:12.176197"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.7ms)  (1.0ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.209274"], ["updated_at", "2019-02-14 06:46:12.209274"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (2.7ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 06:46:12.228147"], ["updated_at", "2019-02-14 06:46:12.228147"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.242160"], ["updated_at", "2019-02-14 06:46:12.242160"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 06:46:12.253118"], ["updated_at", "2019-02-14 06:46:12.253118"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.274737"], ["updated_at", "2019-02-14 06:46:12.274737"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 06:46:12.286543"], ["updated_at", "2019-02-14 06:46:12.286543"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.299938"], ["updated_at", "2019-02-14 06:46:12.299938"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 06:46:12.309689"], ["updated_at", "2019-02-14 06:46:12.309689"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.323192"], ["updated_at", "2019-02-14 06:46:12.323192"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.333206"], ["updated_at", "2019-02-14 06:46:12.333206"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 55], ["LIMIT", 1]] Account Update (1.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-14 06:46:12.349573"], ["id", 55]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.363090"], ["updated_at", "2019-02-14 06:46:12.363090"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.369314"], ["updated_at", "2019-02-14 06:46:12.369314"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 57], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-14 06:46:12.376676"], ["id", 57]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 57], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.389889"], ["updated_at", "2019-02-14 06:46:12.389889"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-02-14 06:46:12.395666"], ["updated_at", "2019-02-14 06:46:12.395666"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 59], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-02-14 06:46:12.403145"], ["id", 59]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 59], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-02-14 06:46:12.418139"], ["updated_at", "2019-02-14 06:46:12.418139"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-02-14 06:46:12.421612"], ["synced_id", 0], ["id", 60]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-02-14 06:46:12.439736"], ["updated_at", "2019-02-14 06:46:12.439736"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 61], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-02-14 06:46:12.444164"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 61]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 61], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-02-14 06:46:12.467622"], ["updated_at", "2019-02-14 06:46:12.467622"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1550213172"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-02-14 06:46:12.475244"], ["updated_at", "2019-02-14 06:46:12.475244"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1550040372"]]  (2.2ms) COMMIT  (0.7ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 63], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-02-14 06:46:12.482756"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1550299572"], ["id", 63]]  (1.6ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.7ms) BEGIN Account Destroy (0.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 63]]  (1.4ms) COMMIT  (1.3ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.4ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.6ms) BEGIN Started GET "/en/users/login" for 127.0.0.1 at 2019-02-14 14:48:30 +0800  (1.2ms) ROLLBACK  (1.0ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-02-14 14:58:20 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 8ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) ROLLBACK  (1.5ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-02-14 15:21:33 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-02-14 15:21:33 +0800 Processing by SessionsController#create as HTML Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 07:21:33.109043"], ["updated_at", "2019-02-14 07:21:33.109043"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 40ms (ActiveRecord: 13.7ms) Started GET "/" for 127.0.0.1 at 2019-02-14 15:21:33 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 101ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-02-14 15:22:45 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-02-14 15:22:45 +0800 Processing by SessionsController#create as HTML Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 07:22:45.687628"], ["updated_at", "2019-02-14 07:22:45.687628"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 49ms (ActiveRecord: 21.1ms) Started GET "/" for 127.0.0.1 at 2019-02-14 15:22:45 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 111ms (ActiveRecord: 0.0ms)  (3.0ms) ROLLBACK  (0.7ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-02-14 15:23:40 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-02-14 15:23:40 +0800 Processing by SessionsController#create as HTML Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 07:23:40.348474"], ["updated_at", "2019-02-14 07:23:40.348474"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 35ms (ActiveRecord: 13.8ms) Started GET "/" for 127.0.0.1 at 2019-02-14 15:23:40 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 114ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (2.1ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-02-14 15:34:08 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=357a0c50b3c20f897b1ed2869402a24cbd7ce8a9c5595da7" for 127.0.0.1 at 2019-02-14 15:34:08 +0800  (1.0ms) ROLLBACK  (0.7ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-02-14 16:00:37 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-02-14 16:00:37 +0800 Processing by SessionsController#create as HTML Account Load (3.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 Account Exists (3.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-02-14 08:00:37.220561"], ["updated_at", "2019-02-14 08:00:37.220561"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 68ms (ActiveRecord: 33.0ms) Started GET "/" for 127.0.0.1 at 2019-02-14 16:00:37 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 121ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.6ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-03-12 12:35:50 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-03-12 12:35:50 +0800 Processing by SessionsController#create as HTML Account Load (5.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-03-12 04:35:50.960136"], ["updated_at", "2019-03-12 04:35:50.960136"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 66ms (ActiveRecord: 32.4ms) Started GET "/" for 127.0.0.1 at 2019-03-12 12:35:50 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 104ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-03-12 12:36:22 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-03-12 12:36:22 +0800 Processing by SessionsController#create as HTML Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-03-12 04:36:22.150395"], ["updated_at", "2019-03-12 04:36:22.150395"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 45ms (ActiveRecord: 15.6ms) Started GET "/" for 127.0.0.1 at 2019-03-12 12:36:22 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 112ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-03-12 13:26:21 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-03-12 13:26:21 +0800 Processing by SessionsController#create as HTML Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-03-12 05:26:22.029556"], ["updated_at", "2019-03-12 05:26:22.029556"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 46ms (ActiveRecord: 19.0ms) Started GET "/" for 127.0.0.1 at 2019-03-12 13:26:22 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 107ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.2ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-03-13 10:29:13 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-03-13 10:29:13 +0800 Processing by SessionsController#create as HTML Account Load (3.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (5.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-03-13 02:29:13.195547"], ["updated_at", "2019-03-13 02:29:13.195547"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (3.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 73ms (ActiveRecord: 29.9ms) Started GET "/" for 127.0.0.1 at 2019-03-13 10:29:13 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 105ms (ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.0ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-03-13 10:31:50 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-03-13 10:31:50 +0800 Processing by SessionsController#create as HTML Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-03-13 02:31:50.255952"], ["updated_at", "2019-03-13 02:31:50.255952"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 39ms (ActiveRecord: 15.8ms) Started GET "/" for 127.0.0.1 at 2019-03-13 10:31:50 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 111ms (ActiveRecord: 0.0ms)  (2.1ms) ROLLBACK  (0.8ms) BEGIN Started GET "/auth/bookingsync/" for 127.0.0.1 at 2019-03-13 10:33:34 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-03-13 10:33:34 +0800 Processing by SessionsController#create as HTML Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-03-13 02:33:34.727338"], ["updated_at", "2019-03-13 02:33:34.727338"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 72ms (ActiveRecord: 22.0ms) Started GET "/" for 127.0.0.1 at 2019-03-13 10:33:34 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 110ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.7ms) BEGIN Started GET "/" for 127.0.0.1 at 2019-03-13 10:35:49 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 109ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 10:36:19 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 12ms (Views: 9.2ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 10:42:03 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 6ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN Started GET "/en/users/login" for 127.0.0.1 at 2019-03-13 10:51:50 +0800  (1.2ms) ROLLBACK  (0.7ms) BEGIN Started GET "/en/users/login" for 127.0.0.1 at 2019-03-13 10:58:53 +0800  (1.2ms) ROLLBACK  (0.7ms) BEGIN Started GET "/en/users/login" for 127.0.0.1 at 2019-03-13 11:07:32 +0800  (1.5ms) ROLLBACK  (0.8ms) BEGIN Started GET "/en/users/login" for 127.0.0.1 at 2019-03-13 11:08:40 +0800  (1.3ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 11:13:06 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 6ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.7ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 11:14:37 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 6ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 11:15:06 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 6ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 11:20:26 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 11:20:26 +0800 Started GET "/auth/bookingsync/callback" for 127.0.0.1 at 2019-03-13 11:20:26 +0800 Processing by SessionsController#create as HTML Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-03-13 03:20:26.997775"], ["updated_at", "2019-03-13 03:20:26.997775"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://www.example.com/ Completed 302 Found in 36ms (ActiveRecord: 16.5ms) Started GET "/" for 127.0.0.1 at 2019-03-13 11:20:27 +0800 Processing by HomeController#index as HTML Completed 406 Not Acceptable in 108ms (ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.4ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 11:25:05 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 11:25:05 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=4cdb3f1046709ca8957c462f78e71da80d79ab176e88d42e" for 127.0.0.1 at 2019-03-13 11:25:05 +0800  (1.3ms) ROLLBACK  (0.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 11:26:36 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 11:26:36 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=7d282cc5f6bd49049748ebf8661b2785c1a05e5e5d5ba125" for 127.0.0.1 at 2019-03-13 11:26:36 +0800  (1.1ms) ROLLBACK  (0.9ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 11:38:40 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 15ms (Views: 11.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (1.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (1.6ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) ROLLBACK  (0.6ms) BEGIN  (1.4ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (1.4ms) ROLLBACK  (0.7ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 12:09:46 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 4ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 12:09:46 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=68fef71d0dee1abf26787410eab97683d97e634bbdeebc9e" for 127.0.0.1 at 2019-03-13 12:09:46 +0800  (1.3ms) ROLLBACK  (0.8ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 12:14:12 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 4ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 12:14:12 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=e731c5073fc3d0b50ca29acbdab17a1ab9a8fec18d384ff7" for 127.0.0.1 at 2019-03-13 12:14:12 +0800  (1.2ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 12:14:35 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 4ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 12:14:35 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=eb53f0dcc19a32a67b5b168254c07564c4d02bf41a13b14b" for 127.0.0.1 at 2019-03-13 12:14:35 +0800  (1.4ms) ROLLBACK  (0.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 12:15:27 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 12:15:27 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=448299114c85996a4efd8f720d30674d6387ca41ff956d87" for 127.0.0.1 at 2019-03-13 12:15:27 +0800  (1.7ms) ROLLBACK  (1.6ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) ROLLBACK  (0.6ms) BEGIN  (2.2ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 15:58:05 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 7ms (Views: 3.7ms | ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 15:58:05 +0800  (1.2ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 15:58:34 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 9ms (Views: 5.7ms | ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 15:58:35 +0800  (1.2ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 15:58:52 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 8ms (Views: 4.1ms | ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 15:58:52 +0800  (1.2ms) ROLLBACK  (1.1ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 16:08:37 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 9ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 16:08:37 +0800  (1.7ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 17:00:42 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 6ms (Views: 3.1ms | ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 17:00:42 +0800  (1.3ms) ROLLBACK  (0.9ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 17:22:36 +0800 Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 9ms (Views: 5.0ms | ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 17:22:36 +0800  (1.3ms) ROLLBACK  (1.1ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 18:20:23 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 18:20:23 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=5459cd2d8ef0c9601476fabcf2c5a465cd74309ce7e823f4" for 127.0.0.1 at 2019-03-13 18:20:23 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"5459cd2d8ef0c9601476fabcf2c5a465cd74309ce7e823f4"} Completed 500 Internal Server Error in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.9ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 18:21:51 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 18:21:51 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=5c1e11844ec19cc23f661ad6420d552682e354266bb4bacb" for 127.0.0.1 at 2019-03-13 18:21:51 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"5c1e11844ec19cc23f661ad6420d552682e354266bb4bacb"} Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.8ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 18:22:09 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 18:22:09 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=5b400219810bc84e38e691be75abbc33637be926941b1e3e" for 127.0.0.1 at 2019-03-13 18:22:09 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"5b400219810bc84e38e691be75abbc33637be926941b1e3e"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 18:23:00 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 18:23:00 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=a4b73b3a210ddb5c61c8f23156c94e774ab6282008dcc60d" for 127.0.0.1 at 2019-03-13 18:23:00 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"a4b73b3a210ddb5c61c8f23156c94e774ab6282008dcc60d"} Completed 500 Internal Server Error in 4ms (ActiveRecord: 1.9ms)  (1.8ms) ROLLBACK  (1.2ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 18:29:05 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 6ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 18:29:05 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=1c9bed0ae9939cf0196bcccd37c2a3dd75275818ec5c1c42" for 127.0.0.1 at 2019-03-13 18:29:05 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"1c9bed0ae9939cf0196bcccd37c2a3dd75275818ec5c1c42"} Completed 500 Internal Server Error in 7ms (ActiveRecord: 2.7ms)  (1.6ms) ROLLBACK  (1.8ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 18:29:42 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 6ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 18:29:42 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=922fd7fffb09611a47caed2d6e896f6919b510b24e3679aa" for 127.0.0.1 at 2019-03-13 18:29:42 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"922fd7fffb09611a47caed2d6e896f6919b510b24e3679aa"} Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" IS NULL LIMIT $1 [["LIMIT", 1]] Completed 500 Internal Server Error in 66ms (ActiveRecord: 8.8ms)  (1.8ms) ROLLBACK  (1.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-13 18:30:09 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 5ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-13 18:30:09 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=0805d0bb901233cd8f712beb81ec848e88c445d8998282c7" for 127.0.0.1 at 2019-03-13 18:30:09 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"0805d0bb901233cd8f712beb81ec848e88c445d8998282c7"} Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" IS NULL LIMIT $1 [["LIMIT", 1]] Completed 500 Internal Server Error in 38ms (ActiveRecord: 13.3ms)  (1.5ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:22:25 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:22:25 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=e47de99a1e82e65c3e49d84ede5f3d72e2c9c5b3176ff656" for 127.0.0.1 at 2019-03-14 11:22:25 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"e47de99a1e82e65c3e49d84ede5f3d72e2c9c5b3176ff656"} Completed 500 Internal Server Error in 8ms (ActiveRecord: 4.0ms)  (2.0ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:25:28 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:25:28 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=7b137f580f5a8d3a6d51251629ec28448abf10a16029241d" for 127.0.0.1 at 2019-03-14 11:25:28 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"7b137f580f5a8d3a6d51251629ec28448abf10a16029241d"} Completed 500 Internal Server Error in 4ms (ActiveRecord: 1.7ms)  (1.5ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:27:37 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:27:37 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=5d9b846656e68b68d7bd14268eb5b21355558a9eb756c78a" for 127.0.0.1 at 2019-03-14 11:27:37 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"5d9b846656e68b68d7bd14268eb5b21355558a9eb756c78a"} Completed 500 Internal Server Error in 6ms (ActiveRecord: 3.4ms)  (1.9ms) ROLLBACK  (0.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:32:32 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:32:32 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=1fc06ce5ccfb26aab8b0bb042b6a81c93c45b781b0c12e4d" for 127.0.0.1 at 2019-03-14 11:32:32 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"1fc06ce5ccfb26aab8b0bb042b6a81c93c45b781b0c12e4d"} Completed 500 Internal Server Error in 5ms (ActiveRecord: 1.9ms)  (0.9ms) ROLLBACK  (0.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:37:32 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:37:32 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=c5ba6cea3127653ac7d630a3ae183b92699b54758c686dc3" for 127.0.0.1 at 2019-03-14 11:37:32 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"c5ba6cea3127653ac7d630a3ae183b92699b54758c686dc3"} Completed 500 Internal Server Error in 8ms (ActiveRecord: 4.4ms)  (2.2ms) ROLLBACK  (0.4ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:38:10 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:38:10 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=539c0690612c1a2dc557cdd8fe7f8cd6a7adf47d9f01b335" for 127.0.0.1 at 2019-03-14 11:38:10 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"539c0690612c1a2dc557cdd8fe7f8cd6a7adf47d9f01b335"} Completed 500 Internal Server Error in 4ms (ActiveRecord: 1.9ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:38:33 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:38:33 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=8461aede9a3e9a25ff75464bc6553eeb740decaf614c679a" for 127.0.0.1 at 2019-03-14 11:38:33 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"8461aede9a3e9a25ff75464bc6553eeb740decaf614c679a"} Completed 500 Internal Server Error in 4ms (ActiveRecord: 2.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:39:28 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:39:28 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=a2198042b9770813a83e36ce0304a3edd40be7b7b49b5722" for 127.0.0.1 at 2019-03-14 11:39:28 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"a2198042b9770813a83e36ce0304a3edd40be7b7b49b5722"} Completed 500 Internal Server Error in 6ms (ActiveRecord: 2.0ms)  (1.1ms) ROLLBACK  (0.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 11:43:13 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 11:43:13 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=66df4bd9b1197238cc68293bdceff0b2753383c7922aab72" for 127.0.0.1 at 2019-03-14 11:43:13 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"66df4bd9b1197238cc68293bdceff0b2753383c7922aab72"} Completed 500 Internal Server Error in 5ms (ActiveRecord: 3.1ms)  (1.9ms) ROLLBACK  (0.7ms) SELECT pg_try_advisory_lock(7458657555131878620)  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateRemoteAccounts (20190313080010)  (0.6ms) BEGIN  (28.1ms) CREATE TABLE "remote_accounts" ("id" bigserial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) ActiveRecord::SchemaMigration Create (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190313080010"]]  (1.7ms) COMMIT Migrating to CreateDoorkeeperTables (20190313095223)  (1.0ms) BEGIN  (8.3ms) CREATE TABLE "oauth_applications" ("id" bigserial primary key, "name" character varying NOT NULL, "uid" character varying NOT NULL, "secret" character varying NOT NULL, "redirect_uri" text NOT NULL, "scopes" character varying DEFAULT '' NOT NULL, "confidential" boolean DEFAULT TRUE NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.1ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")  (5.3ms) CREATE TABLE "oauth_access_grants" ("id" bigserial primary key, "resource_owner_id" bigint NOT NULL, "application_id" bigint NOT NULL, "token" character varying NOT NULL, "expires_in" integer NOT NULL, "redirect_uri" text NOT NULL, "created_at" timestamp NOT NULL, "revoked_at" timestamp, "scopes" character varying)  (2.3ms) CREATE INDEX "index_oauth_access_grants_on_resource_owner_id" ON "oauth_access_grants" ("resource_owner_id")  (2.7ms) CREATE INDEX "index_oauth_access_grants_on_application_id" ON "oauth_access_grants" ("application_id")  (3.4ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")  (5.0ms) ALTER TABLE "oauth_access_grants" ADD CONSTRAINT "fk_rails_b4b53e07b8" FOREIGN KEY ("application_id") REFERENCES "oauth_applications" ("id")   (8.4ms) CREATE TABLE "oauth_access_tokens" ("id" bigserial primary key, "resource_owner_id" bigint, "application_id" bigint, "token" character varying NOT NULL, "refresh_token" character varying, "expires_in" integer, "revoked_at" timestamp, "created_at" timestamp NOT NULL, "scopes" character varying, "previous_refresh_token" character varying DEFAULT '' NOT NULL)  (4.3ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")  (2.9ms) CREATE INDEX "index_oauth_access_tokens_on_application_id" ON "oauth_access_tokens" ("application_id")  (6.3ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")  (4.6ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")  (2.6ms) ALTER TABLE "oauth_access_tokens" ADD CONSTRAINT "fk_rails_732cb83ab7" FOREIGN KEY ("application_id") REFERENCES "oauth_applications" ("id")  ActiveRecord::SchemaMigration Create (1.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190313095223"]]  (2.8ms) COMMIT ActiveRecord::InternalMetadata Load (5.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (2.7ms) BEGIN  (2.7ms) COMMIT  (1.6ms) SELECT pg_advisory_unlock(7458657555131878620)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 13:55:24 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 13:55:24 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=ad74ee86b06514a9db2bf93e723b03ed31f30bca9c914f11" for 127.0.0.1 at 2019-03-14 13:55:24 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"ad74ee86b06514a9db2bf93e723b03ed31f30bca9c914f11"} Doorkeeper::Application Load (1.6ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", ""], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (8.0ms) Completed 200 OK in 223ms (Views: 193.6ms | ActiveRecord: 9.8ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 14:02:31 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 14:02:31 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=92ac696c583e0afc962db467a90c2343498467ac9ba08543" for 127.0.0.1 at 2019-03-14 14:02:31 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"92ac696c583e0afc962db467a90c2343498467ac9ba08543"} RemoteAccount Load (1.6ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."id" IS NULL LIMIT $1 [["LIMIT", 1]] Doorkeeper::Application Load (1.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", ""], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (12.1ms) Completed 200 OK in 158ms (Views: 115.8ms | ActiveRecord: 9.4ms)  (1.1ms) ROLLBACK  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT pg_try_advisory_lock(7458657555131878620)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateDoorkeeperTables (20190313095223)  (0.6ms) BEGIN  (3.6ms) ALTER TABLE "oauth_access_tokens" DROP CONSTRAINT "fk_rails_732cb83ab7"  (0.6ms) DROP INDEX "index_oauth_access_tokens_on_refresh_token"  (1.0ms) DROP INDEX "index_oauth_access_tokens_on_token"  (2.7ms) DROP TABLE "oauth_access_tokens"  (1.1ms) ALTER TABLE "oauth_access_grants" DROP CONSTRAINT "fk_rails_b4b53e07b8"  (0.7ms) DROP INDEX "index_oauth_access_grants_on_token"  (1.2ms) DROP TABLE "oauth_access_grants"  (0.7ms) DROP INDEX "index_oauth_applications_on_uid"  (1.4ms) DROP TABLE "oauth_applications" ActiveRecord::SchemaMigration Destroy (1.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20190313095223"]]  (2.4ms) COMMIT  (0.9ms) SELECT pg_advisory_unlock(7458657555131878620)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT pg_try_advisory_lock(7458657555131878620)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateDoorkeeperTables (20190313095223)  (0.7ms) BEGIN  (13.3ms) CREATE TABLE "oauth_applications" ("id" bigserial primary key, "name" character varying NOT NULL, "uid" character varying NOT NULL, "secret" character varying NOT NULL, "redirect_uri" text NOT NULL, "scopes" character varying DEFAULT '' NOT NULL, "confidential" boolean DEFAULT TRUE NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")  (5.1ms) CREATE TABLE "oauth_access_grants" ("id" bigserial primary key, "resource_owner_id" bigint NOT NULL, "application_id" bigint NOT NULL, "token" character varying NOT NULL, "expires_in" integer NOT NULL, "redirect_uri" text NOT NULL, "created_at" timestamp NOT NULL, "revoked_at" timestamp, "scopes" character varying)  (2.2ms) CREATE INDEX "index_oauth_access_grants_on_resource_owner_id" ON "oauth_access_grants" ("resource_owner_id")  (2.0ms) CREATE INDEX "index_oauth_access_grants_on_application_id" ON "oauth_access_grants" ("application_id")  (1.9ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")  (1.3ms) ALTER TABLE "oauth_access_grants" ADD CONSTRAINT "fk_rails_b4b53e07b8" FOREIGN KEY ("application_id") REFERENCES "oauth_applications" ("id")   (1.0ms) ALTER TABLE "oauth_access_grants" ADD CONSTRAINT "fk_rails_330c32d8d9" FOREIGN KEY ("resource_owner_id") REFERENCES "remote_accounts" ("id")   (7.2ms) CREATE TABLE "oauth_access_tokens" ("id" bigserial primary key, "resource_owner_id" bigint, "application_id" bigint, "token" character varying NOT NULL, "refresh_token" character varying, "expires_in" integer, "revoked_at" timestamp, "created_at" timestamp NOT NULL, "scopes" character varying, "previous_refresh_token" character varying DEFAULT '' NOT NULL)  (2.1ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")  (2.5ms) CREATE INDEX "index_oauth_access_tokens_on_application_id" ON "oauth_access_tokens" ("application_id")  (5.1ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")  (3.9ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")  (3.5ms) ALTER TABLE "oauth_access_tokens" ADD CONSTRAINT "fk_rails_732cb83ab7" FOREIGN KEY ("application_id") REFERENCES "oauth_applications" ("id")   (2.1ms) ALTER TABLE "oauth_access_tokens" ADD CONSTRAINT "fk_rails_ee63f25419" FOREIGN KEY ("resource_owner_id") REFERENCES "remote_accounts" ("id")  ActiveRecord::SchemaMigration Create (1.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190313095223"]]  (3.2ms) COMMIT ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.3ms) BEGIN  (1.2ms) COMMIT  (1.2ms) SELECT pg_advisory_unlock(7458657555131878620)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 14:43:34 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 14:43:34 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=b2c839e05a8a93ddaca3561cc437556fafc46d38328f166b" for 127.0.0.1 at 2019-03-14 14:43:34 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"b2c839e05a8a93ddaca3561cc437556fafc46d38328f166b"} RemoteAccount Load (1.3ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."id" IS NULL LIMIT $1 [["LIMIT", 1]] Doorkeeper::Application Load (0.9ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", ""], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (9.2ms) Completed 200 OK in 217ms (Views: 189.2ms | ActiveRecord: 10.9ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 14:46:50 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 14:46:50 +0800 Started GET "/oauth/authorize?client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=08730f386ba78a30882ac5a47c67c83c20671de08d3d2902" for 127.0.0.1 at 2019-03-14 14:46:50 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>nil, "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"08730f386ba78a30882ac5a47c67c83c20671de08d3d2902"} RemoteAccount Load (1.1ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."id" IS NULL LIMIT $1 [["LIMIT", 1]] Doorkeeper::Application Load (3.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", ""], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (8.6ms) Completed 200 OK in 260ms (Views: 223.4ms | ActiveRecord: 14.2ms)  (0.9ms) ROLLBACK  (0.4ms) BEGIN Started GET "/authenticated" for 127.0.0.1 at 2019-03-14 14:48:51 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-14 14:48:51 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=a38521c09e6dc1af12e8dcada7fda5ee0e711ed482c21d53" for 127.0.0.1 at 2019-03-14 14:48:51 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"a38521c09e6dc1af12e8dcada7fda5ee0e711ed482c21d53"} RemoteAccount Load (1.4ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."id" IS NULL LIMIT $1 [["LIMIT", 1]] Doorkeeper::Application Load (1.1ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (5.9ms) Completed 200 OK in 220ms (Views: 192.5ms | ActiveRecord: 9.3ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.6ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]]  (1.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (2.0ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (3.6ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:25:05.906841"], ["updated_at", "2019-03-19 04:25:05.906841"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:25:05 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:25:05 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=62c588c782e2e6d4d840ab768ad03253c4245978862debdb" for 127.0.0.1 at 2019-03-19 12:25:05 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"62c588c782e2e6d4d840ab768ad03253c4245978862debdb"} RemoteAccount Load (1.1ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 RemoteAccount Create (1.9ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:25:05.965461"], ["updated_at", "2019-03-19 04:25:05.965461"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.8ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (5.8ms) Completed 200 OK in 148ms (Views: 124.1ms | ActiveRecord: 11.2ms)  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.8ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.8ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:27:02.976921"], ["updated_at", "2019-03-19 04:27:02.976921"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:27:02 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:27:02 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=96d3bd358b5597e561fd254d59b5cda725eabb55b15fee85" for 127.0.0.1 at 2019-03-19 12:27:03 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"96d3bd358b5597e561fd254d59b5cda725eabb55b15fee85"} RemoteAccount Load (1.2ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 RemoteAccount Create (1.3ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:27:03.025923"], ["updated_at", "2019-03-19 04:27:03.025923"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.9ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (5.8ms) Completed 200 OK in 197ms (Views: 172.9ms | ActiveRecord: 12.4ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.7ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.3ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:28:59.393869"], ["updated_at", "2019-03-19 04:28:59.393869"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:28:59 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 4ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:28:59 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=05f26e8ece3b5b0bf1f1eddbfe3e4af51e160751c71e936b" for 127.0.0.1 at 2019-03-19 12:28:59 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"05f26e8ece3b5b0bf1f1eddbfe3e4af51e160751c71e936b"} RemoteAccount Load (1.3ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 RemoteAccount Create (1.4ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:28:59.452721"], ["updated_at", "2019-03-19 04:28:59.452721"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (1.1ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (6.1ms) Completed 200 OK in 210ms (Views: 184.2ms | ActiveRecord: 13.1ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.7ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.2ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:29:13.476353"], ["updated_at", "2019-03-19 04:29:13.476353"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:29:13 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 4ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:29:13 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=8fd40148137f73c64d4071fb0ebc0ad80ddb1f362935cfc1" for 127.0.0.1 at 2019-03-19 12:29:13 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"8fd40148137f73c64d4071fb0ebc0ad80ddb1f362935cfc1"} RemoteAccount Load (2.3ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 RemoteAccount Create (1.3ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:29:13.527952"], ["updated_at", "2019-03-19 04:29:13.527952"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (1.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (5.5ms) Completed 200 OK in 146ms (Views: 119.5ms | ActiveRecord: 15.8ms)  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.7ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.2ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:29:43.409381"], ["updated_at", "2019-03-19 04:29:43.409381"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:29:43 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:29:43 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=551fde134af15669dabc8b8a5c71eea5f1cd3f291b6a16c6" for 127.0.0.1 at 2019-03-19 12:29:43 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"551fde134af15669dabc8b8a5c71eea5f1cd3f291b6a16c6"} RemoteAccount Load (1.4ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 RemoteAccount Create (1.0ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:29:43.459668"], ["updated_at", "2019-03-19 04:29:43.459668"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (1.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (6.3ms) Completed 200 OK in 202ms (Views: 177.5ms | ActiveRecord: 12.2ms)  (1.4ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.7ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.3ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:32:16.567902"], ["updated_at", "2019-03-19 04:32:16.567902"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:32:16 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:32:16 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=6f297f71871db9aeb53f2eb21f87f1829affd437aad7d408" for 127.0.0.1 at 2019-03-19 12:32:16 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"6f297f71871db9aeb53f2eb21f87f1829affd437aad7d408"} RemoteAccount Load (0.9ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 RemoteAccount Create (1.1ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:32:16.613617"], ["updated_at", "2019-03-19 04:32:16.613617"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.8ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (6.2ms) Completed 200 OK in 139ms (Views: 118.0ms | ActiveRecord: 10.3ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.4ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.1ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:35:21.196621"], ["updated_at", "2019-03-19 04:35:21.196621"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:35:21 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:35:21 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=13975ae9efc52c39171d6f966d1189c5fa2f2446076e5acc" for 127.0.0.1 at 2019-03-19 12:35:21 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"13975ae9efc52c39171d6f966d1189c5fa2f2446076e5acc"} RemoteAccount Load (1.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 RemoteAccount Create (1.0ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:35:21.238418"], ["updated_at", "2019-03-19 04:35:21.238418"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (1.4ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (5.7ms) Completed 200 OK in 182ms (Views: 162.4ms | ActiveRecord: 9.5ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.8ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.5ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://localhost:3000/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:37:13.511997"], ["updated_at", "2019-03-19 04:37:13.511997"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:37:13 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:37:13 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=a3ad7c7370c0f0d8d1c5f27a506b5a222848b4152a30e5d5" for 127.0.0.1 at 2019-03-19 12:37:13 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"a3ad7c7370c0f0d8d1c5f27a506b5a222848b4152a30e5d5"} RemoteAccount Load (1.3ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 RemoteAccount Create (0.9ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:37:13.558948"], ["updated_at", "2019-03-19 04:37:13.558948"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.9ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (5.4ms) Completed 200 OK in 140ms (Views: 118.9ms | ActiveRecord: 10.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.6ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.2ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:39:56.712232"], ["updated_at", "2019-03-19 04:39:56.712232"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:39:56 +0800 Processing by AuthenticatedController#index as HTML Redirected to https://my.awesome.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:39:56 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=https%3A%2F%2Fmy.awesome.host%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=eb80c9d7bb8661ab40b25f4d356f29c78d7508e1e340fb5d" for 127.0.0.1 at 2019-03-19 12:39:56 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "response_type"=>"code", "state"=>"eb80c9d7bb8661ab40b25f4d356f29c78d7508e1e340fb5d"} RemoteAccount Load (1.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 RemoteAccount Create (1.3ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:39:56.754913"], ["updated_at", "2019-03-19 04:39:56.754913"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (1.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] RemoteAccount Load (1.4ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::AccessToken Load (9.1ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."application_id" = $1 AND "oauth_access_tokens"."resource_owner_id" = $2 AND "oauth_access_tokens"."revoked_at" IS NULL ORDER BY "oauth_access_tokens"."created_at" DESC [["application_id", 9], ["resource_owner_id", 9]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application (6.9ms) Completed 200 OK in 218ms (Views: 179.7ms | ActiveRecord: 23.7ms)  (1.3ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.6ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.2ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:40:10.425060"], ["updated_at", "2019-03-19 04:40:10.425060"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:40:10 +0800 Processing by AuthenticatedController#index as HTML Redirected to https://my.awesome.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:40:10 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=https%3A%2F%2Fmy.awesome.host%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=ac79040cef10e03ded58273e2b6db30286284bd8a7011c7e" for 127.0.0.1 at 2019-03-19 12:40:10 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "response_type"=>"code", "state"=>"ac79040cef10e03ded58273e2b6db30286284bd8a7011c7e"} RemoteAccount Load (1.8ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 RemoteAccount Create (1.7ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:40:10.470489"], ["updated_at", "2019-03-19 04:40:10.470489"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (1.3ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] RemoteAccount Load (1.2ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::AccessToken Load (2.1ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."application_id" = $1 AND "oauth_access_tokens"."resource_owner_id" = $2 AND "oauth_access_tokens"."revoked_at" IS NULL ORDER BY "oauth_access_tokens"."created_at" DESC [["application_id", 10], ["resource_owner_id", 10]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application (7.2ms) Completed 200 OK in 158ms (Views: 120.9ms | ActiveRecord: 20.0ms) Started POST "/oauth/authorize" for 127.0.0.1 at 2019-03-19 12:40:10 +0800 Processing by Doorkeeper::AuthorizationsController#create as HTML Parameters: {"utf8"=>"✓", "client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "state"=>"ac79040cef10e03ded58273e2b6db30286284bd8a7011c7e", "response_type"=>"code", "scope"=>"", "code_challenge"=>"", "code_challenge_method"=>"", "commit"=>"Authorize"} RemoteAccount Load (3.8ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::Application Load (1.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Doorkeeper::AccessGrant Exists (1.2ms) SELECT 1 AS one FROM "oauth_access_grants" WHERE "oauth_access_grants"."token" = $1 LIMIT $2 [["token", "919df635b85feaef9d7522bf1ea1b7903547e501e18f99dad079a8d54c6748dc"], ["LIMIT", 1]] Doorkeeper::AccessGrant Create (1.7ms) INSERT INTO "oauth_access_grants" ("resource_owner_id", "application_id", "token", "expires_in", "redirect_uri", "created_at", "scopes") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["resource_owner_id", 10], ["application_id", 10], ["token", "919df635b85feaef9d7522bf1ea1b7903547e501e18f99dad079a8d54c6748dc"], ["expires_in", 600], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:40:10.649223"], ["scopes", ""]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to https://my.awesome.host/auth/bookingsync/callback?code=919df635b85feaef9d7522bf1ea1b7903547e501e18f99dad079a8d54c6748dc&state=ac79040cef10e03ded58273e2b6db30286284bd8a7011c7e Completed 302 Found in 24ms (ActiveRecord: 13.5ms) Started GET "/auth/bookingsync/callback?code=[FILTERED]&state=ac79040cef10e03ded58273e2b6db30286284bd8a7011c7e" for 127.0.0.1 at 2019-03-19 12:40:10 +0800 Started GET "/auth/failure?message=invalid_credentials&strategy=bookingsync" for 127.0.0.1 at 2019-03-19 12:40:10 +0800 Processing by SessionsController#failure as HTML Parameters: {"message"=>"invalid_credentials", "strategy"=>"bookingsync"} Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Completed 200 OK in 11ms (Views: 6.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (2.0ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.5ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:40:34.211728"], ["updated_at", "2019-03-19 04:40:34.211728"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:40:34 +0800 Processing by AuthenticatedController#index as HTML Redirected to https://my.awesome.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:40:34 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=https%3A%2F%2Fmy.awesome.host%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=14f61982c5268db862a14a747b40685c073d5b9541172641" for 127.0.0.1 at 2019-03-19 12:40:34 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "response_type"=>"code", "state"=>"14f61982c5268db862a14a747b40685c073d5b9541172641"} RemoteAccount Load (1.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 RemoteAccount Create (1.1ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:40:34.257977"], ["updated_at", "2019-03-19 04:40:34.257977"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.8ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] RemoteAccount Load (1.7ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::AccessToken Load (2.4ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."application_id" = $1 AND "oauth_access_tokens"."resource_owner_id" = $2 AND "oauth_access_tokens"."revoked_at" IS NULL ORDER BY "oauth_access_tokens"."created_at" DESC [["application_id", 11], ["resource_owner_id", 11]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application (7.6ms) Completed 200 OK in 155ms (Views: 123.0ms | ActiveRecord: 16.5ms) Started POST "/oauth/authorize" for 127.0.0.1 at 2019-03-19 12:40:34 +0800 Processing by Doorkeeper::AuthorizationsController#create as HTML Parameters: {"utf8"=>"✓", "client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "state"=>"14f61982c5268db862a14a747b40685c073d5b9541172641", "response_type"=>"code", "scope"=>"", "code_challenge"=>"", "code_challenge_method"=>"", "commit"=>"Authorize"} RemoteAccount Load (2.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::Application Load (1.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Doorkeeper::AccessGrant Exists (1.0ms) SELECT 1 AS one FROM "oauth_access_grants" WHERE "oauth_access_grants"."token" = $1 LIMIT $2 [["token", "9671baa9e566ddb6aa6f6a8827a673763f61fd25692356e47c97f82ba4155e96"], ["LIMIT", 1]] Doorkeeper::AccessGrant Create (1.0ms) INSERT INTO "oauth_access_grants" ("resource_owner_id", "application_id", "token", "expires_in", "redirect_uri", "created_at", "scopes") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["resource_owner_id", 11], ["application_id", 11], ["token", "9671baa9e566ddb6aa6f6a8827a673763f61fd25692356e47c97f82ba4155e96"], ["expires_in", 600], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:40:34.425965"], ["scopes", ""]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to https://my.awesome.host/auth/bookingsync/callback?code=9671baa9e566ddb6aa6f6a8827a673763f61fd25692356e47c97f82ba4155e96&state=14f61982c5268db862a14a747b40685c073d5b9541172641 Completed 302 Found in 20ms (ActiveRecord: 10.6ms) Started GET "/auth/bookingsync/callback?code=[FILTERED]&state=14f61982c5268db862a14a747b40685c073d5b9541172641" for 127.0.0.1 at 2019-03-19 12:40:34 +0800 Started GET "/auth/failure?message=invalid_credentials&strategy=bookingsync" for 127.0.0.1 at 2019-03-19 12:40:34 +0800 Processing by SessionsController#failure as HTML Parameters: {"message"=>"invalid_credentials", "strategy"=>"bookingsync"} Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Completed 200 OK in 9ms (Views: 6.2ms | ActiveRecord: 0.0ms)  (2.7ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (3.4ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.9ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:42:16.858999"], ["updated_at", "2019-03-19 04:42:16.858999"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:42:16 +0800 Processing by AuthenticatedController#index as HTML Redirected to https://my.awesome.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 5ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:42:16 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=https%3A%2F%2Fmy.awesome.host%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=3da5e153dcdc7cd4990423e27ee5999dde4968ec8ce6961f" for 127.0.0.1 at 2019-03-19 12:42:16 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "response_type"=>"code", "state"=>"3da5e153dcdc7cd4990423e27ee5999dde4968ec8ce6961f"} RemoteAccount Load (1.6ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 RemoteAccount Create (1.3ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:42:16.920021"], ["updated_at", "2019-03-19 04:42:16.920021"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.8ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] RemoteAccount Load (1.3ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::AccessToken Load (1.6ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."application_id" = $1 AND "oauth_access_tokens"."resource_owner_id" = $2 AND "oauth_access_tokens"."revoked_at" IS NULL ORDER BY "oauth_access_tokens"."created_at" DESC [["application_id", 12], ["resource_owner_id", 12]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application (6.9ms) Completed 200 OK in 150ms (Views: 117.2ms | ActiveRecord: 17.1ms) Started POST "/oauth/authorize" for 127.0.0.1 at 2019-03-19 12:42:17 +0800 Processing by Doorkeeper::AuthorizationsController#create as HTML Parameters: {"utf8"=>"✓", "client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "state"=>"3da5e153dcdc7cd4990423e27ee5999dde4968ec8ce6961f", "response_type"=>"code", "scope"=>"", "code_challenge"=>"", "code_challenge_method"=>"", "commit"=>"Authorize"} RemoteAccount Load (1.3ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::Application Load (0.9ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Doorkeeper::AccessGrant Exists (1.2ms) SELECT 1 AS one FROM "oauth_access_grants" WHERE "oauth_access_grants"."token" = $1 LIMIT $2 [["token", "e47b3cd29908ee473850f568f412ab161f25b9cab90c55fed774b623f95e1960"], ["LIMIT", 1]] Doorkeeper::AccessGrant Create (1.1ms) INSERT INTO "oauth_access_grants" ("resource_owner_id", "application_id", "token", "expires_in", "redirect_uri", "created_at", "scopes") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["resource_owner_id", 12], ["application_id", 12], ["token", "e47b3cd29908ee473850f568f412ab161f25b9cab90c55fed774b623f95e1960"], ["expires_in", 600], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:42:17.077678"], ["scopes", ""]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to https://my.awesome.host/auth/bookingsync/callback?code=e47b3cd29908ee473850f568f412ab161f25b9cab90c55fed774b623f95e1960&state=3da5e153dcdc7cd4990423e27ee5999dde4968ec8ce6961f Completed 302 Found in 20ms (ActiveRecord: 9.4ms) Started GET "/auth/bookingsync/callback?code=[FILTERED]&state=3da5e153dcdc7cd4990423e27ee5999dde4968ec8ce6961f" for 127.0.0.1 at 2019-03-19 12:42:17 +0800 Started GET "/auth/failure?message=invalid_credentials&strategy=bookingsync" for 127.0.0.1 at 2019-03-19 12:42:17 +0800 Processing by SessionsController#failure as HTML Parameters: {"message"=>"invalid_credentials", "strategy"=>"bookingsync"} Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Completed 200 OK in 10ms (Views: 6.2ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.7ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.3ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:44:17.115508"], ["updated_at", "2019-03-19 04:44:17.115508"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.7ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.6ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:45:32.605894"], ["updated_at", "2019-03-19 04:45:32.605894"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 12:45:32 +0800 Processing by AuthenticatedController#index as HTML Redirected to https://my.awesome.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 12:45:32 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=https%3A%2F%2Fmy.awesome.host%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=896f85171c731629c776cfe0b32ed8168200966eb288d811" for 127.0.0.1 at 2019-03-19 12:45:32 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "response_type"=>"code", "state"=>"896f85171c731629c776cfe0b32ed8168200966eb288d811"} RemoteAccount Load (1.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 RemoteAccount Create (1.3ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 04:45:32.650224"], ["updated_at", "2019-03-19 04:45:32.650224"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.9ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] RemoteAccount Load (1.2ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::AccessToken Load (1.6ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."application_id" = $1 AND "oauth_access_tokens"."resource_owner_id" = $2 AND "oauth_access_tokens"."revoked_at" IS NULL ORDER BY "oauth_access_tokens"."created_at" DESC [["application_id", 14], ["resource_owner_id", 13]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application (7.0ms) Completed 200 OK in 198ms (Views: 168.1ms | ActiveRecord: 15.7ms) Started POST "/oauth/authorize" for 127.0.0.1 at 2019-03-19 12:45:32 +0800 Processing by Doorkeeper::AuthorizationsController#create as HTML Parameters: {"utf8"=>"✓", "client_id"=>"app_id", "redirect_uri"=>"https://my.awesome.host/auth/bookingsync/callback", "state"=>"896f85171c731629c776cfe0b32ed8168200966eb288d811", "response_type"=>"code", "scope"=>"", "code_challenge"=>"", "code_challenge_method"=>"", "commit"=>"Authorize"} RemoteAccount Load (1.3ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]] Doorkeeper::Application Load (1.0ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] CACHE RemoteAccount Load (0.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Doorkeeper::AccessGrant Exists (1.1ms) SELECT 1 AS one FROM "oauth_access_grants" WHERE "oauth_access_grants"."token" = $1 LIMIT $2 [["token", "eda95a493ca91f87d4dbeddf29adc37eeee957419f3284bd862e8260afba93db"], ["LIMIT", 1]] Doorkeeper::AccessGrant Create (1.2ms) INSERT INTO "oauth_access_grants" ("resource_owner_id", "application_id", "token", "expires_in", "redirect_uri", "created_at", "scopes") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["resource_owner_id", 13], ["application_id", 14], ["token", "eda95a493ca91f87d4dbeddf29adc37eeee957419f3284bd862e8260afba93db"], ["expires_in", 600], ["redirect_uri", "https://my.awesome.host/auth/bookingsync/callback"], ["created_at", "2019-03-19 04:45:32.859087"], ["scopes", ""]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to https://my.awesome.host/auth/bookingsync/callback?code=eda95a493ca91f87d4dbeddf29adc37eeee957419f3284bd862e8260afba93db&state=896f85171c731629c776cfe0b32ed8168200966eb288d811 Completed 302 Found in 19ms (ActiveRecord: 9.9ms) Started GET "/auth/bookingsync/callback?code=[FILTERED]&state=896f85171c731629c776cfe0b32ed8168200966eb288d811" for 127.0.0.1 at 2019-03-19 12:45:32 +0800  (1.9ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (3.0ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.4ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "urn:ietf:wg:oauth:2.0:oob"], ["created_at", "2019-03-19 05:01:10.481969"], ["updated_at", "2019-03-19 05:01:10.481969"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 13:01:10 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 13:01:10 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=03ad3161fa9f84e1b391bbda21e07cf46740e89a99bb7fe2" for 127.0.0.1 at 2019-03-19 13:01:10 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"03ad3161fa9f84e1b391bbda21e07cf46740e89a99bb7fe2"} RemoteAccount Load (2.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 RemoteAccount Create (1.7ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 05:01:10.535716"], ["updated_at", "2019-03-19 05:01:10.535716"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (1.2ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (7.7ms) Completed 200 OK in 198ms (Views: 172.4ms | ActiveRecord: 14.4ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.7ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.2ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "urn:ietf:wg:oauth:2.0:oob"], ["created_at", "2019-03-19 05:01:25.308454"], ["updated_at", "2019-03-19 05:01:25.308454"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 13:01:25 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 13:01:25 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=d61de02eb53e36d824c655d73f3a8dc314051f372a487180" for 127.0.0.1 at 2019-03-19 13:01:25 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"d61de02eb53e36d824c655d73f3a8dc314051f372a487180"} RemoteAccount Load (1.0ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 RemoteAccount Create (1.1ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 05:01:25.350950"], ["updated_at", "2019-03-19 05:01:25.350950"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.9ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (5.3ms) Completed 200 OK in 137ms (Views: 117.0ms | ActiveRecord: 9.5ms)  (3.7ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Doorkeeper::Application Exists (1.9ms) SELECT 1 AS one FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Doorkeeper::Application Create (1.4ms) INSERT INTO "oauth_applications" ("name", "uid", "secret", "redirect_uri", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "TestApp"], ["uid", "app_id"], ["secret", "app_secret"], ["redirect_uri", "urn:ietf:wg:oauth:2.0:oob"], ["created_at", "2019-03-19 05:01:41.276590"], ["updated_at", "2019-03-19 05:01:41.276590"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Started GET "/authenticated" for 127.0.0.1 at 2019-03-19 13:01:41 +0800 Processing by AuthenticatedController#index as HTML Redirected to http://www.example.com/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 3ms (ActiveRecord: 0.0ms) Started GET "/auth/bookingsync/?account_id=" for 127.0.0.1 at 2019-03-19 13:01:41 +0800 Started GET "/oauth/authorize?client_id=app_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fauth%2Fbookingsync%2Fcallback&response_type=code&state=7c3ce173ecf01a11b4d11842ddcef556733b314d84b081e7" for 127.0.0.1 at 2019-03-19 13:01:41 +0800 Processing by Doorkeeper::AuthorizationsController#new as HTML Parameters: {"client_id"=>"app_id", "redirect_uri"=>"http://www.example.com/auth/bookingsync/callback", "response_type"=>"code", "state"=>"7c3ce173ecf01a11b4d11842ddcef556733b314d84b081e7"} RemoteAccount Load (1.6ms) SELECT "remote_accounts".* FROM "remote_accounts" WHERE "remote_accounts"."name" = $1 LIMIT $2 [["name", "Toto"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 RemoteAccount Create (1.0ms) INSERT INTO "remote_accounts" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Toto"], ["created_at", "2019-03-19 05:01:41.322284"], ["updated_at", "2019-03-19 05:01:41.322284"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Doorkeeper::Application Load (0.8ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "app_id"], ["LIMIT", 1]] Rendering /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application Rendered /Users/marc/.rvm/gems/ruby-2.4.1/gems/doorkeeper-5.0.2/app/views/doorkeeper/authorizations/error.html.erb within layouts/doorkeeper/application (6.1ms) Completed 200 OK in 179ms (Views: 158.3ms | ActiveRecord: 11.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) ROLLBACK  (1.4ms) BEGIN  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (1.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (4.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (6.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:41:44.945812"], ["updated_at", "2019-04-03 05:41:44.945812"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 65ms (ActiveRecord: 49.2ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:41:44.963155"], ["updated_at", "2019-04-03 05:41:44.963155"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 4.3ms)  (0.8ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:41:44.976381"], ["updated_at", "2019-04-03 05:41:44.976381"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.3ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 7.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:41:45.042850"], ["updated_at", "2019-04-03 05:41:45.042850"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:41:45.147667"], ["updated_at", "2019-04-03 05:41:45.147667"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 79], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 05:41:45.153987"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 79]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 79], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:41:45.166339"], ["updated_at", "2019-04-03 05:41:45.166339"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (0.9ms) BEGIN  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:41:45.185947"], ["updated_at", "2019-04-03 05:41:45.185947"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 05:41:45.211301"], ["updated_at", "2019-04-03 05:41:45.211301"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554356505"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 05:41:45.221159"], ["updated_at", "2019-04-03 05:41:45.221159"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554183705"]]  (2.4ms) COMMIT  (1.2ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 83], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 05:41:45.231994"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554442905"], ["id", 83]]  (1.9ms) COMMIT Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (0.8ms) BEGIN Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 83]]  (1.5ms) COMMIT  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.248005"], ["updated_at", "2019-04-03 05:41:45.248005"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.252646"], ["updated_at", "2019-04-03 05:41:45.252646"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 85], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:41:45.258494"], ["id", 85]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 85], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.267163"], ["updated_at", "2019-04-03 05:41:45.267163"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.271552"], ["updated_at", "2019-04-03 05:41:45.271552"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 87], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:41:45.278612"], ["id", 87]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 87], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.288557"], ["updated_at", "2019-04-03 05:41:45.288557"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.294012"], ["updated_at", "2019-04-03 05:41:45.294012"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 89], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:41:45.300321"], ["id", 89]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.308568"], ["updated_at", "2019-04-03 05:41:45.308568"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.313193"], ["updated_at", "2019-04-03 05:41:45.313193"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 91], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:41:45.319013"], ["id", 91]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.325996"], ["updated_at", "2019-04-03 05:41:45.325996"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (3.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:41:45.339779"], ["updated_at", "2019-04-03 05:41:45.339779"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.349458"], ["updated_at", "2019-04-03 05:41:45.349458"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:41:45.359344"], ["updated_at", "2019-04-03 05:41:45.359344"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.370285"], ["updated_at", "2019-04-03 05:41:45.370285"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:41:45.377636"], ["updated_at", "2019-04-03 05:41:45.377636"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:41:45.386892"], ["updated_at", "2019-04-03 05:41:45.386892"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:41:45.394509"], ["updated_at", "2019-04-03 05:41:45.394509"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:41:45.403108"], ["updated_at", "2019-04-03 05:41:45.403108"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-03 05:41:45.416011"], ["updated_at", "2019-04-03 05:41:45.416011"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-03 05:41:45.420156"], ["synced_id", 0], ["id", 101]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 7.0ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:42:36.470069"], ["updated_at", "2019-04-03 05:42:36.470069"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 57ms (ActiveRecord: 19.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:42:36.489283"], ["updated_at", "2019-04-03 05:42:36.489283"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:42:36.509134"], ["updated_at", "2019-04-03 05:42:36.509134"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.7ms)  (1.0ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.549640"], ["updated_at", "2019-04-03 05:42:36.549640"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.582996"], ["updated_at", "2019-04-03 05:42:36.582996"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.610306"], ["updated_at", "2019-04-03 05:42:36.610306"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.626221"], ["updated_at", "2019-04-03 05:42:36.626221"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.650621"], ["updated_at", "2019-04-03 05:42:36.650621"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.668032"], ["updated_at", "2019-04-03 05:42:36.668032"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 05:42:36.693691"], ["updated_at", "2019-04-03 05:42:36.693691"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-03 05:42:36.700046"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:36.711911"], ["updated_at", "2019-04-03 05:42:36.711911"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:36.718015"], ["updated_at", "2019-04-03 05:42:36.718015"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:36.722680"], ["updated_at", "2019-04-03 05:42:36.722680"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:36.727270"], ["updated_at", "2019-04-03 05:42:36.727270"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.740630"], ["updated_at", "2019-04-03 05:42:36.740630"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.745494"], ["updated_at", "2019-04-03 05:42:36.745494"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.755508"], ["updated_at", "2019-04-03 05:42:36.755508"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.759976"], ["updated_at", "2019-04-03 05:42:36.759976"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 05:42:36.771715"], ["updated_at", "2019-04-03 05:42:36.771715"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 05:42:36.782939"], ["updated_at", "2019-04-03 05:42:36.782939"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.787456"], ["updated_at", "2019-04-03 05:42:36.787456"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 05:42:36.796892"], ["updated_at", "2019-04-03 05:42:36.796892"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.801814"], ["updated_at", "2019-04-03 05:42:36.801814"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 05:42:36.811321"], ["updated_at", "2019-04-03 05:42:36.811321"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.816795"], ["updated_at", "2019-04-03 05:42:36.816795"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.824983"], ["updated_at", "2019-04-03 05:42:36.824983"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.829975"], ["updated_at", "2019-04-03 05:42:36.829975"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 17], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:42:36.836387"], ["id", 17]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.844727"], ["updated_at", "2019-04-03 05:42:36.844727"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.850514"], ["updated_at", "2019-04-03 05:42:36.850514"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 19], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:42:36.857957"], ["id", 19]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.867573"], ["updated_at", "2019-04-03 05:42:36.867573"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.871889"], ["updated_at", "2019-04-03 05:42:36.871889"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 21], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:42:36.877534"], ["id", 21]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-03 05:42:36.889428"], ["updated_at", "2019-04-03 05:42:36.889428"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554356556"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-03 05:42:36.898417"], ["updated_at", "2019-04-03 05:42:36.898417"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554183756"], ["host", "example.test"]]  (2.1ms) COMMIT  (1.2ms) BEGIN MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 24], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-03 05:42:36.908070"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554442956"], ["id", 24]]  (1.9ms) COMMIT MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) BEGIN MultiApplicationsAccount Destroy (1.3ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 24]]  (1.7ms) COMMIT  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:36.923750"], ["updated_at", "2019-04-03 05:42:36.923750"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.932968"], ["updated_at", "2019-04-03 05:42:36.932968"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:36.954779"], ["updated_at", "2019-04-03 05:42:36.954779"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.963269"], ["updated_at", "2019-04-03 05:42:36.963269"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.970745"], ["updated_at", "2019-04-03 05:42:36.970745"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:36.981257"], ["updated_at", "2019-04-03 05:42:36.981257"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 05:42:36.999481"], ["updated_at", "2019-04-03 05:42:36.999481"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.007283"], ["updated_at", "2019-04-03 05:42:37.007283"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:37.015376"], ["updated_at", "2019-04-03 05:42:37.015376"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:37.075489"], ["updated_at", "2019-04-03 05:42:37.075489"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 05:42:37.086921"], ["updated_at", "2019-04-03 05:42:37.086921"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 05:42:37.091831"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 4]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:42:37.102656"], ["updated_at", "2019-04-03 05:42:37.102656"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-03 05:42:37.114133"], ["updated_at", "2019-04-03 05:42:37.114133"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-03 05:42:37.118633"], ["synced_id", 0], ["id", 6]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.131291"], ["updated_at", "2019-04-03 05:42:37.131291"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:42:37.138480"], ["updated_at", "2019-04-03 05:42:37.138480"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.147713"], ["updated_at", "2019-04-03 05:42:37.147713"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:42:37.154260"], ["updated_at", "2019-04-03 05:42:37.154260"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.162233"], ["updated_at", "2019-04-03 05:42:37.162233"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:42:37.168152"], ["updated_at", "2019-04-03 05:42:37.168152"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.175792"], ["updated_at", "2019-04-03 05:42:37.175792"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 05:42:37.182273"], ["updated_at", "2019-04-03 05:42:37.182273"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.191201"], ["updated_at", "2019-04-03 05:42:37.191201"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.196597"], ["updated_at", "2019-04-03 05:42:37.196597"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 16], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:42:37.202962"], ["id", 16]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.212191"], ["updated_at", "2019-04-03 05:42:37.212191"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.217653"], ["updated_at", "2019-04-03 05:42:37.217653"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 18], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:42:37.224071"], ["id", 18]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.233640"], ["updated_at", "2019-04-03 05:42:37.233640"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.238103"], ["updated_at", "2019-04-03 05:42:37.238103"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:42:37.243964"], ["id", 20]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.253918"], ["updated_at", "2019-04-03 05:42:37.253918"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.258867"], ["updated_at", "2019-04-03 05:42:37.258867"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 22], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 05:42:37.265710"], ["id", 22]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 05:42:37.273649"], ["updated_at", "2019-04-03 05:42:37.273649"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554183757"]]  (7.4ms) COMMIT  (1.1ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 23], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 05:42:37.286782"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554442957"], ["id", 23]]  (1.8ms) COMMIT Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (0.8ms) BEGIN Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 23]]  (1.7ms) COMMIT  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 05:42:37.301531"], ["updated_at", "2019-04-03 05:42:37.301531"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554356557"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:42:37.314326"], ["updated_at", "2019-04-03 05:42:37.314326"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:42:37.325106"], ["updated_at", "2019-04-03 05:42:37.325106"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 05:42:37.335923"], ["updated_at", "2019-04-03 05:42:37.335923"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.350354"], ["updated_at", "2019-04-03 05:42:37.350354"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 05:42:37.355507"], ["updated_at", "2019-04-03 05:42:37.355507"], ["synced_id", 123], ["host", "test.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 05:42:37.366036"], ["updated_at", "2019-04-03 05:42:37.366036"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 07:09:12.612873"], ["updated_at", "2019-04-03 07:09:12.612873"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:12.647135"], ["updated_at", "2019-04-03 07:09:12.647135"], ["synced_id", 123], ["host", "example.host"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:12.655439"], ["updated_at", "2019-04-03 07:09:12.655439"], ["synced_id", 123], ["host", "test.host"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:12.674826"], ["updated_at", "2019-04-03 07:09:12.674826"], ["synced_id", 123], ["host", "test.example"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.696263"], ["updated_at", "2019-04-03 07:09:12.696263"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.705233"], ["updated_at", "2019-04-03 07:09:12.705233"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.717359"], ["updated_at", "2019-04-03 07:09:12.717359"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.721849"], ["updated_at", "2019-04-03 07:09:12.721849"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.735115"], ["updated_at", "2019-04-03 07:09:12.735115"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.739746"], ["updated_at", "2019-04-03 07:09:12.739746"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 07:09:12.752724"], ["updated_at", "2019-04-03 07:09:12.752724"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 07:09:12.766879"], ["updated_at", "2019-04-03 07:09:12.766879"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.772673"], ["updated_at", "2019-04-03 07:09:12.772673"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 07:09:12.785417"], ["updated_at", "2019-04-03 07:09:12.785417"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.794167"], ["updated_at", "2019-04-03 07:09:12.794167"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 07:09:12.809204"], ["updated_at", "2019-04-03 07:09:12.809204"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.818849"], ["updated_at", "2019-04-03 07:09:12.818849"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.5ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.832305"], ["updated_at", "2019-04-03 07:09:12.832305"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.839862"], ["updated_at", "2019-04-03 07:09:12.839862"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 47], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 07:09:12.850025"], ["id", 47]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.864596"], ["updated_at", "2019-04-03 07:09:12.864596"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.871584"], ["updated_at", "2019-04-03 07:09:12.871584"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 49], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 07:09:12.883982"], ["id", 49]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 49], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.897136"], ["updated_at", "2019-04-03 07:09:12.897136"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.903778"], ["updated_at", "2019-04-03 07:09:12.903778"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 51], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 07:09:12.913441"], ["id", 51]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 51], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:12.925158"], ["updated_at", "2019-04-03 07:09:12.925158"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:12.934490"], ["updated_at", "2019-04-03 07:09:12.934490"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-03 07:09:12.948142"], ["updated_at", "2019-04-03 07:09:12.948142"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554188952"], ["host", "example.test"]]  (3.9ms) COMMIT  (1.0ms) BEGIN MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 54], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-03 07:09:12.959094"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554448152"], ["id", 54]]  (3.3ms) COMMIT MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.0ms) BEGIN MultiApplicationsAccount Destroy (1.3ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 54]]  (1.8ms) COMMIT  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-03 07:09:12.977473"], ["updated_at", "2019-04-03 07:09:12.977473"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554361752"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:12.988791"], ["updated_at", "2019-04-03 07:09:12.988791"], ["synced_id", 1], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:12.997565"], ["updated_at", "2019-04-03 07:09:12.997565"], ["synced_id", 2], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.004331"], ["updated_at", "2019-04-03 07:09:13.004331"], ["synced_id", 1], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.014151"], ["updated_at", "2019-04-03 07:09:13.014151"], ["synced_id", 2], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 07:09:13.030663"], ["updated_at", "2019-04-03 07:09:13.030663"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 60], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-03 07:09:13.037349"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 60]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 60], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.049078"], ["updated_at", "2019-04-03 07:09:13.049078"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.058721"], ["updated_at", "2019-04-03 07:09:13.058721"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 07:09:13.072513"], ["updated_at", "2019-04-03 07:09:13.072513"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) ROLLBACK  (2.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.097868"], ["updated_at", "2019-04-03 07:09:13.097868"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (5.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.5ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 07:09:13.184273"], ["updated_at", "2019-04-03 07:09:13.184273"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.8ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 Account Exists (3.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 07:09:13.202327"], ["updated_at", "2019-04-03 07:09:13.202327"], ["synced_id", 123]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (2.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.221176"], ["updated_at", "2019-04-03 07:09:13.221176"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.228734"], ["updated_at", "2019-04-03 07:09:13.228734"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 32], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 07:09:13.239371"], ["id", 32]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.251745"], ["updated_at", "2019-04-03 07:09:13.251745"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.258524"], ["updated_at", "2019-04-03 07:09:13.258524"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 34], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 07:09:13.269641"], ["id", 34]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.278161"], ["updated_at", "2019-04-03 07:09:13.278161"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.283234"], ["updated_at", "2019-04-03 07:09:13.283234"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 36], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 07:09:13.290372"], ["id", 36]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 36], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.304001"], ["updated_at", "2019-04-03 07:09:13.304001"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.308366"], ["updated_at", "2019-04-03 07:09:13.308366"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 38], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 07:09:13.316424"], ["id", 38]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 38], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (2.7ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.332669"], ["updated_at", "2019-04-03 07:09:13.332669"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 07:09:13.344945"], ["updated_at", "2019-04-03 07:09:13.344945"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT COUNT(*) FROM "accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.356862"], ["updated_at", "2019-04-03 07:09:13.356862"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 07:09:13.366758"], ["updated_at", "2019-04-03 07:09:13.366758"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.381609"], ["updated_at", "2019-04-03 07:09:13.381609"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 07:09:13.389522"], ["updated_at", "2019-04-03 07:09:13.389522"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 07:09:13.402985"], ["updated_at", "2019-04-03 07:09:13.402985"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 07:09:13.412798"], ["updated_at", "2019-04-03 07:09:13.412798"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.8ms) BEGIN Account Load (1.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-03 07:09:13.430934"], ["updated_at", "2019-04-03 07:09:13.430934"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-03 07:09:13.436623"], ["synced_id", 0], ["id", 47]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 07:09:13.458490"], ["updated_at", "2019-04-03 07:09:13.458490"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 07:09:13.470074"], ["updated_at", "2019-04-03 07:09:13.470074"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554361753"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.4ms) BEGIN Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 07:09:13.479772"], ["updated_at", "2019-04-03 07:09:13.479772"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554188953"]]  (9.1ms) COMMIT  (1.6ms) BEGIN Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 50], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 07:09:13.497139"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554448153"], ["id", 50]]  (2.1ms) COMMIT Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (0.8ms) BEGIN Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 50]]  (4.0ms) COMMIT  (1.4ms) BEGIN  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 07:09:13.525049"], ["updated_at", "2019-04-03 07:09:13.525049"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.537462"], ["updated_at", "2019-04-03 07:09:13.537462"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 51], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 07:09:13.542269"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 51]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 51], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.563779"], ["updated_at", "2019-04-03 07:09:13.563779"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (3.6ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.587434"], ["updated_at", "2019-04-03 07:09:13.587434"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.8ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.619784"], ["updated_at", "2019-04-03 07:09:13.619784"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.647150"], ["updated_at", "2019-04-03 07:09:13.647150"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.671567"], ["updated_at", "2019-04-03 07:09:13.671567"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (2.9ms) SAVEPOINT active_record_1 Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.699040"], ["updated_at", "2019-04-03 07:09:13.699040"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 07:09:13.724327"], ["updated_at", "2019-04-03 07:09:13.724327"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (1.4ms) BEGIN  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (3.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 07:09:13.826126"], ["updated_at", "2019-04-03 07:09:13.826126"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 8.9ms)  (1.9ms) ROLLBACK  (2.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 07:09:13.851400"], ["updated_at", "2019-04-03 07:09:13.851400"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 14ms (ActiveRecord: 7.5ms)  (1.6ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 07:09:13.873627"], ["updated_at", "2019-04-03 07:09:13.873627"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 7.9ms)  (2.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.790322"], ["updated_at", "2019-04-03 14:05:03.790322"], ["synced_id", 123], ["host", "example.host"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.799367"], ["updated_at", "2019-04-03 14:05:03.799367"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 14:05:03.824372"], ["updated_at", "2019-04-03 14:05:03.824372"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 14:05:03.849626"], ["updated_at", "2019-04-03 14:05:03.849626"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.8ms) ROLLBACK  (1.3ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 14:05:03.864460"], ["updated_at", "2019-04-03 14:05:03.864460"], ["synced_id", 123]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.1ms) BEGIN Account Load (2.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-03 14:05:03.885652"], ["updated_at", "2019-04-03 14:05:03.885652"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Account Update (1.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-03 14:05:03.891572"], ["synced_id", 0], ["id", 57]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.917925"], ["updated_at", "2019-04-03 14:05:03.917925"], ["provider", "bookingsync"], ["synced_id", 456]]  (3.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.927610"], ["updated_at", "2019-04-03 14:05:03.927610"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 59], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 14:05:03.937851"], ["id", 59]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.948174"], ["updated_at", "2019-04-03 14:05:03.948174"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.957830"], ["updated_at", "2019-04-03 14:05:03.957830"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 61], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 14:05:03.966097"], ["id", 61]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.974619"], ["updated_at", "2019-04-03 14:05:03.974619"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:03.979132"], ["updated_at", "2019-04-03 14:05:03.979132"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 63], ["LIMIT", 1]] Account Update (2.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 14:05:03.985436"], ["id", 63]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 63], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.002267"], ["updated_at", "2019-04-03 14:05:04.002267"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.011022"], ["updated_at", "2019-04-03 14:05:04.011022"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 65], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 14:05:04.019438"], ["id", 65]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 65], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.029000"], ["updated_at", "2019-04-03 14:05:04.029000"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (3.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 14:05:04.043696"], ["updated_at", "2019-04-03 14:05:04.043696"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.056741"], ["updated_at", "2019-04-03 14:05:04.056741"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 14:05:04.062758"], ["updated_at", "2019-04-03 14:05:04.062758"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.072350"], ["updated_at", "2019-04-03 14:05:04.072350"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 14:05:04.081333"], ["updated_at", "2019-04-03 14:05:04.081333"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.091075"], ["updated_at", "2019-04-03 14:05:04.091075"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 14:05:04.097340"], ["updated_at", "2019-04-03 14:05:04.097340"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.108278"], ["updated_at", "2019-04-03 14:05:04.108278"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 74], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 14:05:04.113953"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 74]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 74], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 14:05:04.128831"], ["updated_at", "2019-04-03 14:05:04.128831"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (7.5ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-03 14:05:04.146349"], ["updated_at", "2019-04-03 14:05:04.146349"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.5ms) BEGIN  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 14:05:04.180944"], ["updated_at", "2019-04-03 14:05:04.180944"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554386704"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.2ms) BEGIN Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 14:05:04.194112"], ["updated_at", "2019-04-03 14:05:04.194112"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554213904"]]  (3.0ms) COMMIT  (1.4ms) BEGIN Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 78], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-03 14:05:04.206342"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554473104"], ["id", 78]]  (4.0ms) COMMIT Account Load (1.3ms) SELECT "accounts".* FROM "accounts"  (1.0ms) BEGIN Account Destroy (1.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 78]]  (2.5ms) COMMIT  (1.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 14:05:04.259213"], ["updated_at", "2019-04-03 14:05:04.259213"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/authenticated Completed 302 Found in 14ms (ActiveRecord: 8.1ms)  (1.5ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 14:05:04.280392"], ["updated_at", "2019-04-03 14:05:04.280392"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/authenticated Completed 302 Found in 13ms (ActiveRecord: 7.7ms)  (1.1ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-03 14:05:04.296096"], ["updated_at", "2019-04-03 14:05:04.296096"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 5.3ms)  (1.1ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (2.8ms) BEGIN  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) ROLLBACK  (1.3ms) BEGIN  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.365906"], ["updated_at", "2019-04-03 14:05:04.365906"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (3.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.400905"], ["updated_at", "2019-04-03 14:05:04.400905"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.423498"], ["updated_at", "2019-04-03 14:05:04.423498"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (3.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.443530"], ["updated_at", "2019-04-03 14:05:04.443530"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (3.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.469490"], ["updated_at", "2019-04-03 14:05:04.469490"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.509947"], ["updated_at", "2019-04-03 14:05:04.509947"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (3.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.535463"], ["updated_at", "2019-04-03 14:05:04.535463"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.553943"], ["updated_at", "2019-04-03 14:05:04.553943"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.566619"], ["updated_at", "2019-04-03 14:05:04.566619"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.574355"], ["updated_at", "2019-04-03 14:05:04.574355"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.583363"], ["updated_at", "2019-04-03 14:05:04.583363"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (3.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.594902"], ["updated_at", "2019-04-03 14:05:04.594902"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.606731"], ["updated_at", "2019-04-03 14:05:04.606731"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (2.5ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.626402"], ["updated_at", "2019-04-03 14:05:04.626402"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (3.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.636600"], ["updated_at", "2019-04-03 14:05:04.636600"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.5ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-03 14:05:04.652207"], ["updated_at", "2019-04-03 14:05:04.652207"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554213904"], ["host", "example.test"]]  (2.8ms) COMMIT  (1.2ms) BEGIN MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 72], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-03 14:05:04.663876"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554473104"], ["id", 72]]  (2.5ms) COMMIT MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) BEGIN MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 72]]  (1.6ms) COMMIT  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-03 14:05:04.679587"], ["updated_at", "2019-04-03 14:05:04.679587"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554386704"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 14:05:04.691109"], ["updated_at", "2019-04-03 14:05:04.691109"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 74], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-03 14:05:04.698224"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 74]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 74], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.722082"], ["updated_at", "2019-04-03 14:05:04.722082"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.730430"], ["updated_at", "2019-04-03 14:05:04.730430"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 14:05:04.740799"], ["updated_at", "2019-04-03 14:05:04.740799"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 14:05:04.752646"], ["updated_at", "2019-04-03 14:05:04.752646"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.763042"], ["updated_at", "2019-04-03 14:05:04.763042"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 14:05:04.776587"], ["updated_at", "2019-04-03 14:05:04.776587"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.781444"], ["updated_at", "2019-04-03 14:05:04.781444"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.4ms) BEGIN MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-03 14:05:04.794887"], ["updated_at", "2019-04-03 14:05:04.794887"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.802531"], ["updated_at", "2019-04-03 14:05:04.802531"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.816908"], ["updated_at", "2019-04-03 14:05:04.816908"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.826478"], ["updated_at", "2019-04-03 14:05:04.826478"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 84], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 14:05:04.835289"], ["id", 84]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.843663"], ["updated_at", "2019-04-03 14:05:04.843663"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.848013"], ["updated_at", "2019-04-03 14:05:04.848013"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (4.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 86], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 14:05:04.859173"], ["id", 86]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 86], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.871795"], ["updated_at", "2019-04-03 14:05:04.871795"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.876501"], ["updated_at", "2019-04-03 14:05:04.876501"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 88], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-03 14:05:04.881959"], ["id", 88]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 88], ["LIMIT", 1]]  (2.6ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.895546"], ["updated_at", "2019-04-03 14:05:04.895546"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-03 14:05:04.902332"], ["updated_at", "2019-04-03 14:05:04.902332"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.917814"], ["updated_at", "2019-04-03 14:05:04.917814"], ["synced_id", 1], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.926750"], ["updated_at", "2019-04-03 14:05:04.926750"], ["synced_id", 2], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.933861"], ["updated_at", "2019-04-03 14:05:04.933861"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-03 14:05:04.939405"], ["updated_at", "2019-04-03 14:05:04.939405"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-03 14:05:04.949711"], ["updated_at", "2019-04-03 14:05:04.949711"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (1.1ms) BEGIN  (3.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:10:33.603008"], ["updated_at", "2019-04-04 07:10:33.603008"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 97], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:10:33.609016"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 97]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 97], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:33.623284"], ["updated_at", "2019-04-04 07:10:33.623284"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.646047"], ["updated_at", "2019-04-04 07:10:33.646047"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.654161"], ["updated_at", "2019-04-04 07:10:33.654161"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:33.669084"], ["updated_at", "2019-04-04 07:10:33.669084"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.679107"], ["updated_at", "2019-04-04 07:10:33.679107"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (2.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.2ms) ROLLBACK  (1.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:10:33.709726"], ["updated_at", "2019-04-04 07:10:33.709726"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:33.717273"], ["updated_at", "2019-04-04 07:10:33.717273"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:33.721769"], ["updated_at", "2019-04-04 07:10:33.721769"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:33.726742"], ["updated_at", "2019-04-04 07:10:33.726742"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:33.733505"], ["updated_at", "2019-04-04 07:10:33.733505"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (2.0ms) BEGIN MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:10:33.752227"], ["updated_at", "2019-04-04 07:10:33.752227"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554275433"], ["host", "example.test"]]  (2.5ms) COMMIT  (1.2ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 105], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:10:33.762488"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554534633"], ["id", 105]]  (2.2ms) COMMIT MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.0ms) BEGIN MultiApplicationsAccount Destroy (1.3ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 105]]  (1.9ms) COMMIT  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:10:33.780486"], ["updated_at", "2019-04-04 07:10:33.780486"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448233"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.793184"], ["updated_at", "2019-04-04 07:10:33.793184"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:33.826354"], ["updated_at", "2019-04-04 07:10:33.826354"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.835242"], ["updated_at", "2019-04-04 07:10:33.835242"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.858532"], ["updated_at", "2019-04-04 07:10:33.858532"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.864492"], ["updated_at", "2019-04-04 07:10:33.864492"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.875106"], ["updated_at", "2019-04-04 07:10:33.875106"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.880783"], ["updated_at", "2019-04-04 07:10:33.880783"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 111], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:10:33.889523"], ["id", 111]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.899839"], ["updated_at", "2019-04-04 07:10:33.899839"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.906690"], ["updated_at", "2019-04-04 07:10:33.906690"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 113], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:10:33.913402"], ["id", 113]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 113], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.922612"], ["updated_at", "2019-04-04 07:10:33.922612"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.927650"], ["updated_at", "2019-04-04 07:10:33.927650"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 115], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:10:33.934684"], ["id", 115]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 115], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.946314"], ["updated_at", "2019-04-04 07:10:33.946314"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.953327"], ["updated_at", "2019-04-04 07:10:33.953327"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:10:33.967135"], ["updated_at", "2019-04-04 07:10:33.967135"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:10:33.978921"], ["updated_at", "2019-04-04 07:10:33.978921"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:33.984935"], ["updated_at", "2019-04-04 07:10:33.984935"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:10:33.997058"], ["updated_at", "2019-04-04 07:10:33.997058"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.002664"], ["updated_at", "2019-04-04 07:10:34.002664"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:10:34.012457"], ["updated_at", "2019-04-04 07:10:34.012457"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.017618"], ["updated_at", "2019-04-04 07:10:34.017618"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.034535"], ["updated_at", "2019-04-04 07:10:34.034535"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.039439"], ["updated_at", "2019-04-04 07:10:34.039439"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:10:34.060796"], ["updated_at", "2019-04-04 07:10:34.060796"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.077083"], ["updated_at", "2019-04-04 07:10:34.077083"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.101084"], ["updated_at", "2019-04-04 07:10:34.101084"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.121817"], ["updated_at", "2019-04-04 07:10:34.121817"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.144864"], ["updated_at", "2019-04-04 07:10:34.144864"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.163012"], ["updated_at", "2019-04-04 07:10:34.163012"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (22.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.204496"], ["updated_at", "2019-04-04 07:10:34.204496"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:10:34.231989"], ["updated_at", "2019-04-04 07:10:34.231989"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.1ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:10:34.246495"], ["updated_at", "2019-04-04 07:10:34.246495"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.2ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:10:34.263128"], ["updated_at", "2019-04-04 07:10:34.263128"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 6.3ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:10:34.315460"], ["updated_at", "2019-04-04 07:10:34.315460"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:10:34.320201"], ["synced_id", 0], ["id", 86]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:10:34.333038"], ["updated_at", "2019-04-04 07:10:34.333038"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.340946"], ["updated_at", "2019-04-04 07:10:34.340946"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 88], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:10:34.345884"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 88]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 88], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:10:34.357082"], ["updated_at", "2019-04-04 07:10:34.357082"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.366298"], ["updated_at", "2019-04-04 07:10:34.366298"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.371011"], ["updated_at", "2019-04-04 07:10:34.371011"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 90], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:10:34.377319"], ["id", 90]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 90], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.389272"], ["updated_at", "2019-04-04 07:10:34.389272"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.396910"], ["updated_at", "2019-04-04 07:10:34.396910"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 92], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:10:34.408228"], ["id", 92]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 92], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.420391"], ["updated_at", "2019-04-04 07:10:34.420391"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.424998"], ["updated_at", "2019-04-04 07:10:34.424998"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 94], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:10:34.430671"], ["id", 94]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.438799"], ["updated_at", "2019-04-04 07:10:34.438799"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.443526"], ["updated_at", "2019-04-04 07:10:34.443526"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 96], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:10:34.450809"], ["id", 96]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.460231"], ["updated_at", "2019-04-04 07:10:34.460231"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:10:34.470365"], ["updated_at", "2019-04-04 07:10:34.470365"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.481547"], ["updated_at", "2019-04-04 07:10:34.481547"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:10:34.488066"], ["updated_at", "2019-04-04 07:10:34.488066"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.496086"], ["updated_at", "2019-04-04 07:10:34.496086"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:10:34.502536"], ["updated_at", "2019-04-04 07:10:34.502536"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:10:34.510842"], ["updated_at", "2019-04-04 07:10:34.510842"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:10:34.517642"], ["updated_at", "2019-04-04 07:10:34.517642"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:10:34.525754"], ["updated_at", "2019-04-04 07:10:34.525754"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:10:34.535290"], ["updated_at", "2019-04-04 07:10:34.535290"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:10:34.544505"], ["updated_at", "2019-04-04 07:10:34.544505"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448234"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:10:34.554945"], ["updated_at", "2019-04-04 07:10:34.554945"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554275434"]]  (2.2ms) COMMIT  (1.1ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 108], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:10:34.564511"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554534634"], ["id", 108]]  (2.1ms) COMMIT Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.7ms) BEGIN Account Destroy (0.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 108]]  (1.5ms) COMMIT  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:10:34.597607"], ["updated_at", "2019-04-04 07:10:34.597607"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.4ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:16:00.759677"], ["updated_at", "2019-04-04 07:16:00.759677"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.0ms) BEGIN Account Load (1.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:16:00.791784"], ["updated_at", "2019-04-04 07:16:00.791784"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:16:00.796766"], ["synced_id", 0], ["id", 109]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.830887"], ["updated_at", "2019-04-04 07:16:00.830887"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:16:00.842997"], ["updated_at", "2019-04-04 07:16:00.842997"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.854065"], ["updated_at", "2019-04-04 07:16:00.854065"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:16:00.860916"], ["updated_at", "2019-04-04 07:16:00.860916"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.869438"], ["updated_at", "2019-04-04 07:16:00.869438"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:16:00.876144"], ["updated_at", "2019-04-04 07:16:00.876144"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.883980"], ["updated_at", "2019-04-04 07:16:00.883980"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:16:00.890063"], ["updated_at", "2019-04-04 07:16:00.890063"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.901126"], ["updated_at", "2019-04-04 07:16:00.901126"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.906622"], ["updated_at", "2019-04-04 07:16:00.906622"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 119], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:16:00.916650"], ["id", 119]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 119], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.929187"], ["updated_at", "2019-04-04 07:16:00.929187"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.934425"], ["updated_at", "2019-04-04 07:16:00.934425"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 121], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:16:00.942950"], ["id", 121]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 121], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.957337"], ["updated_at", "2019-04-04 07:16:00.957337"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.964061"], ["updated_at", "2019-04-04 07:16:00.964061"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 123], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:16:00.970695"], ["id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.979769"], ["updated_at", "2019-04-04 07:16:00.979769"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:00.985152"], ["updated_at", "2019-04-04 07:16:00.985152"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 125], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:16:00.993139"], ["id", 125]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:16:01.002893"], ["updated_at", "2019-04-04 07:16:01.002893"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:16:01.013305"], ["updated_at", "2019-04-04 07:16:01.013305"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.023040"], ["updated_at", "2019-04-04 07:16:01.023040"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 128], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:16:01.027783"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 128]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 128], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:16:01.038890"], ["updated_at", "2019-04-04 07:16:01.038890"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448561"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:16:01.046586"], ["updated_at", "2019-04-04 07:16:01.046586"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554275761"]]  (3.2ms) COMMIT  (0.9ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 130], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:16:01.056041"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554534961"], ["id", 130]]  (1.5ms) COMMIT Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.8ms) BEGIN Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 130]]  (1.9ms) COMMIT  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:16:01.070705"], ["updated_at", "2019-04-04 07:16:01.070705"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:16:01.075706"], ["updated_at", "2019-04-04 07:16:01.075706"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:16:01.080348"], ["updated_at", "2019-04-04 07:16:01.080348"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:16:01.091198"], ["updated_at", "2019-04-04 07:16:01.091198"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.112772"], ["updated_at", "2019-04-04 07:16:01.112772"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.130613"], ["updated_at", "2019-04-04 07:16:01.130613"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.154903"], ["updated_at", "2019-04-04 07:16:01.154903"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.172337"], ["updated_at", "2019-04-04 07:16:01.172337"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.196378"], ["updated_at", "2019-04-04 07:16:01.196378"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.211262"], ["updated_at", "2019-04-04 07:16:01.211262"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.235512"], ["updated_at", "2019-04-04 07:16:01.235512"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.243014"], ["updated_at", "2019-04-04 07:16:01.243014"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:16:01.255387"], ["updated_at", "2019-04-04 07:16:01.255387"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.276555"], ["updated_at", "2019-04-04 07:16:01.276555"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:16:01.348036"], ["updated_at", "2019-04-04 07:16:01.348036"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 6.0ms)  (1.3ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:16:01.363131"], ["updated_at", "2019-04-04 07:16:01.363131"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 5.4ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:16:01.378556"], ["updated_at", "2019-04-04 07:16:01.378556"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.7ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.402941"], ["updated_at", "2019-04-04 07:16:01.402941"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.411991"], ["updated_at", "2019-04-04 07:16:01.411991"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:16:01.423773"], ["updated_at", "2019-04-04 07:16:01.423773"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:16:01.431902"], ["updated_at", "2019-04-04 07:16:01.431902"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 134], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:16:01.436469"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 134]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 134], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:16:01.449227"], ["updated_at", "2019-04-04 07:16:01.449227"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554275761"], ["host", "example.test"]]  (4.0ms) COMMIT  (1.4ms) BEGIN MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 135], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:16:01.462090"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554534961"], ["id", 135]]  (1.9ms) COMMIT MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) BEGIN MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 135]]  (2.7ms) COMMIT  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:16:01.479858"], ["updated_at", "2019-04-04 07:16:01.479858"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448561"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.489998"], ["updated_at", "2019-04-04 07:16:01.489998"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.511846"], ["updated_at", "2019-04-04 07:16:01.511846"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.516692"], ["updated_at", "2019-04-04 07:16:01.516692"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.522524"], ["updated_at", "2019-04-04 07:16:01.522524"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.527625"], ["updated_at", "2019-04-04 07:16:01.527625"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.539392"], ["updated_at", "2019-04-04 07:16:01.539392"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.545243"], ["updated_at", "2019-04-04 07:16:01.545243"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:16:01.554110"], ["updated_at", "2019-04-04 07:16:01.554110"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:16:01.564471"], ["updated_at", "2019-04-04 07:16:01.564471"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.569079"], ["updated_at", "2019-04-04 07:16:01.569079"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:16:01.578349"], ["updated_at", "2019-04-04 07:16:01.578349"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.582917"], ["updated_at", "2019-04-04 07:16:01.582917"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:16:01.592943"], ["updated_at", "2019-04-04 07:16:01.592943"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.598239"], ["updated_at", "2019-04-04 07:16:01.598239"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.607389"], ["updated_at", "2019-04-04 07:16:01.607389"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.612713"], ["updated_at", "2019-04-04 07:16:01.612713"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 151], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:16:01.619849"], ["id", 151]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.628679"], ["updated_at", "2019-04-04 07:16:01.628679"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.634658"], ["updated_at", "2019-04-04 07:16:01.634658"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 153], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:16:01.642057"], ["id", 153]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 153], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.653048"], ["updated_at", "2019-04-04 07:16:01.653048"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.658777"], ["updated_at", "2019-04-04 07:16:01.658777"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 155], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:16:01.666762"], ["id", 155]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 155], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.677794"], ["updated_at", "2019-04-04 07:16:01.677794"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.682638"], ["updated_at", "2019-04-04 07:16:01.682638"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.696125"], ["updated_at", "2019-04-04 07:16:01.696125"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.703941"], ["updated_at", "2019-04-04 07:16:01.703941"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:16:01.713429"], ["updated_at", "2019-04-04 07:16:01.713429"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.720694"], ["updated_at", "2019-04-04 07:16:01.720694"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:16:01.728341"], ["updated_at", "2019-04-04 07:16:01.728341"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.515978"], ["updated_at", "2019-04-04 07:20:12.515978"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.537327"], ["updated_at", "2019-04-04 07:20:12.537327"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Load (2.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.577916"], ["updated_at", "2019-04-04 07:20:12.577916"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.596411"], ["updated_at", "2019-04-04 07:20:12.596411"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.625076"], ["updated_at", "2019-04-04 07:20:12.625076"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.650039"], ["updated_at", "2019-04-04 07:20:12.650039"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.676321"], ["updated_at", "2019-04-04 07:20:12.676321"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.683094"], ["updated_at", "2019-04-04 07:20:12.683094"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 140], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:20:12.690991"], ["id", 140]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 140], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.700762"], ["updated_at", "2019-04-04 07:20:12.700762"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.705636"], ["updated_at", "2019-04-04 07:20:12.705636"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 142], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:20:12.711395"], ["id", 142]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 142], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.721166"], ["updated_at", "2019-04-04 07:20:12.721166"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.726191"], ["updated_at", "2019-04-04 07:20:12.726191"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 144], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:20:12.731820"], ["id", 144]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.739635"], ["updated_at", "2019-04-04 07:20:12.739635"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.744478"], ["updated_at", "2019-04-04 07:20:12.744478"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 146], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:20:12.750245"], ["id", 146]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.758472"], ["updated_at", "2019-04-04 07:20:12.758472"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:20:12.767022"], ["updated_at", "2019-04-04 07:20:12.767022"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.776235"], ["updated_at", "2019-04-04 07:20:12.776235"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:20:12.782416"], ["updated_at", "2019-04-04 07:20:12.782416"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.790067"], ["updated_at", "2019-04-04 07:20:12.790067"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:20:12.797280"], ["updated_at", "2019-04-04 07:20:12.797280"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:12.805384"], ["updated_at", "2019-04-04 07:20:12.805384"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:20:12.811808"], ["updated_at", "2019-04-04 07:20:12.811808"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:20:12.824098"], ["updated_at", "2019-04-04 07:20:12.824098"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:20:12.828413"], ["synced_id", 0], ["id", 155]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:20:12.841646"], ["updated_at", "2019-04-04 07:20:12.841646"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:20:12.868565"], ["updated_at", "2019-04-04 07:20:12.868565"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:20:12.879487"], ["updated_at", "2019-04-04 07:20:12.879487"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448812"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:20:12.890833"], ["updated_at", "2019-04-04 07:20:12.890833"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276012"]]  (7.9ms) COMMIT  (1.1ms) BEGIN Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 158], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:20:12.905387"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535212"], ["id", 158]]  (1.6ms) COMMIT Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 158]]  (1.5ms) COMMIT  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:20:12.919750"], ["updated_at", "2019-04-04 07:20:12.919750"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:20:12.924533"], ["updated_at", "2019-04-04 07:20:12.924533"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:20:12.929155"], ["updated_at", "2019-04-04 07:20:12.929155"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.938395"], ["updated_at", "2019-04-04 07:20:12.938395"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 162], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:20:12.942782"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 162]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 162], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:20:12.955072"], ["updated_at", "2019-04-04 07:20:12.955072"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:20:12.976308"], ["updated_at", "2019-04-04 07:20:12.976308"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:12.988850"], ["updated_at", "2019-04-04 07:20:12.988850"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:20:13.045646"], ["updated_at", "2019-04-04 07:20:13.045646"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 6.3ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:20:13.059475"], ["updated_at", "2019-04-04 07:20:13.059475"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:20:13.072881"], ["updated_at", "2019-04-04 07:20:13.072881"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 5.6ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:20:13.121729"], ["updated_at", "2019-04-04 07:20:13.121729"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 162], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:20:13.128188"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 162]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 162], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:13.142451"], ["updated_at", "2019-04-04 07:20:13.142451"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.152341"], ["updated_at", "2019-04-04 07:20:13.152341"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.164683"], ["updated_at", "2019-04-04 07:20:13.164683"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:20:13.184673"], ["updated_at", "2019-04-04 07:20:13.184673"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276013"], ["host", "example.test"]]  (3.4ms) COMMIT  (1.1ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 165], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:20:13.193911"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535213"], ["id", 165]]  (1.8ms) COMMIT MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) BEGIN MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 165]]  (1.9ms) COMMIT  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:20:13.209578"], ["updated_at", "2019-04-04 07:20:13.209578"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448813"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:13.223459"], ["updated_at", "2019-04-04 07:20:13.223459"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.231299"], ["updated_at", "2019-04-04 07:20:13.231299"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.238331"], ["updated_at", "2019-04-04 07:20:13.238331"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:20:13.249332"], ["updated_at", "2019-04-04 07:20:13.249332"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:13.257771"], ["updated_at", "2019-04-04 07:20:13.257771"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:13.264573"], ["updated_at", "2019-04-04 07:20:13.264573"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:13.270488"], ["updated_at", "2019-04-04 07:20:13.270488"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:13.276403"], ["updated_at", "2019-04-04 07:20:13.276403"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.289603"], ["updated_at", "2019-04-04 07:20:13.289603"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.295286"], ["updated_at", "2019-04-04 07:20:13.295286"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:20:13.305058"], ["updated_at", "2019-04-04 07:20:13.305058"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:20:13.316871"], ["updated_at", "2019-04-04 07:20:13.316871"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.321983"], ["updated_at", "2019-04-04 07:20:13.321983"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:20:13.332010"], ["updated_at", "2019-04-04 07:20:13.332010"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.336916"], ["updated_at", "2019-04-04 07:20:13.336916"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:20:13.347856"], ["updated_at", "2019-04-04 07:20:13.347856"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.355409"], ["updated_at", "2019-04-04 07:20:13.355409"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.368625"], ["updated_at", "2019-04-04 07:20:13.368625"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.374682"], ["updated_at", "2019-04-04 07:20:13.374682"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 182], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:20:13.383228"], ["id", 182]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.396880"], ["updated_at", "2019-04-04 07:20:13.396880"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.405117"], ["updated_at", "2019-04-04 07:20:13.405117"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 184], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:20:13.417402"], ["id", 184]]  (1.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 184], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.432271"], ["updated_at", "2019-04-04 07:20:13.432271"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.440717"], ["updated_at", "2019-04-04 07:20:13.440717"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 186], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:20:13.451258"], ["id", 186]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 186], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.462715"], ["updated_at", "2019-04-04 07:20:13.462715"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.468877"], ["updated_at", "2019-04-04 07:20:13.468877"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:20:13.480563"], ["updated_at", "2019-04-04 07:20:13.480563"], ["synced_id", 123], ["host", "test.example"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:20:13.491187"], ["updated_at", "2019-04-04 07:20:13.491187"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:21:32.784295"], ["updated_at", "2019-04-04 07:21:32.784295"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 191], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (4.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:21:32.801291"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 191]]  (3.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 191], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (2.3ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:32.841013"], ["updated_at", "2019-04-04 07:21:32.841013"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (4.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.4ms) BEGIN MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:21:32.895787"], ["updated_at", "2019-04-04 07:21:32.895787"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276092"], ["host", "example.test"]]  (9.4ms) COMMIT  (4.0ms) BEGIN MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 193], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (5.6ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:21:32.936888"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535292"], ["id", 193]]  (5.5ms) COMMIT MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.3ms) BEGIN MultiApplicationsAccount Destroy (3.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 193]]  (4.1ms) COMMIT  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:21:32.975570"], ["updated_at", "2019-04-04 07:21:32.975570"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448892"], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.7ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:32.998240"], ["updated_at", "2019-04-04 07:21:32.998240"], ["synced_id", 123], ["host", "test.example"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.027362"], ["updated_at", "2019-04-04 07:21:33.027362"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (3.2ms) BEGIN  (2.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.056928"], ["updated_at", "2019-04-04 07:21:33.056928"], ["synced_id", 123], ["host", "test.example"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.9ms) SAVEPOINT active_record_1 Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (4.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.083467"], ["updated_at", "2019-04-04 07:21:33.083467"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.7ms) BEGIN  (4.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.109452"], ["updated_at", "2019-04-04 07:21:33.109452"], ["synced_id", 1], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.122280"], ["updated_at", "2019-04-04 07:21:33.122280"], ["synced_id", 2], ["host", "example.test"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (2.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.138244"], ["updated_at", "2019-04-04 07:21:33.138244"], ["synced_id", 1], ["host", "example2.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (4.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.154509"], ["updated_at", "2019-04-04 07:21:33.154509"], ["synced_id", 2], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (3.4ms) ROLLBACK  (1.7ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:21:33.179109"], ["updated_at", "2019-04-04 07:21:33.179109"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.197686"], ["updated_at", "2019-04-04 07:21:33.197686"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (3.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.210566"], ["updated_at", "2019-04-04 07:21:33.210566"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (3.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 202], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (3.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:21:33.234427"], ["id", 202]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.254015"], ["updated_at", "2019-04-04 07:21:33.254015"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.264830"], ["updated_at", "2019-04-04 07:21:33.264830"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 204], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:21:33.278487"], ["id", 204]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 204], ["LIMIT", 1]]  (2.7ms) ROLLBACK  (2.7ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.303265"], ["updated_at", "2019-04-04 07:21:33.303265"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (3.5ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.317016"], ["updated_at", "2019-04-04 07:21:33.317016"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 206], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (3.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:21:33.331364"], ["id", 206]]  (3.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 206], ["LIMIT", 1]]  (2.7ms) ROLLBACK  (2.3ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.360002"], ["updated_at", "2019-04-04 07:21:33.360002"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.370159"], ["updated_at", "2019-04-04 07:21:33.370159"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:21:33.388210"], ["updated_at", "2019-04-04 07:21:33.388210"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.6ms) ROLLBACK  (2.4ms) BEGIN MultiApplicationsAccount Load (2.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:21:33.414735"], ["updated_at", "2019-04-04 07:21:33.414735"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.423470"], ["updated_at", "2019-04-04 07:21:33.423470"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (3.2ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (2.2ms) BEGIN MultiApplicationsAccount Load (3.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:21:33.455273"], ["updated_at", "2019-04-04 07:21:33.455273"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.464840"], ["updated_at", "2019-04-04 07:21:33.464840"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:21:33.479142"], ["updated_at", "2019-04-04 07:21:33.479142"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.486338"], ["updated_at", "2019-04-04 07:21:33.486338"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.497743"], ["updated_at", "2019-04-04 07:21:33.497743"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.503849"], ["updated_at", "2019-04-04 07:21:33.503849"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.514818"], ["updated_at", "2019-04-04 07:21:33.514818"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.523241"], ["updated_at", "2019-04-04 07:21:33.523241"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.531296"], ["updated_at", "2019-04-04 07:21:33.531296"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:21:33.563890"], ["updated_at", "2019-04-04 07:21:33.563890"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:21:33.573940"], ["updated_at", "2019-04-04 07:21:33.573940"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:21:33.579370"], ["updated_at", "2019-04-04 07:21:33.579370"], ["synced_id", 2]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:21:33.584901"], ["updated_at", "2019-04-04 07:21:33.584901"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:21:33.598744"], ["updated_at", "2019-04-04 07:21:33.598744"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:21:33.613067"], ["updated_at", "2019-04-04 07:21:33.613067"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:21:33.617296"], ["synced_id", 0], ["id", 173]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:21:33.632389"], ["updated_at", "2019-04-04 07:21:33.632389"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448893"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:21:33.642740"], ["updated_at", "2019-04-04 07:21:33.642740"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276093"]]  (1.6ms) COMMIT  (0.7ms) BEGIN Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 175], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:21:33.649918"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535293"], ["id", 175]]  (1.8ms) COMMIT Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN Account Destroy (1.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 175]]  (2.0ms) COMMIT  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:21:33.670219"], ["updated_at", "2019-04-04 07:21:33.670219"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:21:33.679491"], ["updated_at", "2019-04-04 07:21:33.679491"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.687295"], ["updated_at", "2019-04-04 07:21:33.687295"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 177], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:21:33.692282"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 177]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 177], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.701402"], ["updated_at", "2019-04-04 07:21:33.701402"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.705330"], ["updated_at", "2019-04-04 07:21:33.705330"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 179], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:21:33.712213"], ["id", 179]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 179], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.720999"], ["updated_at", "2019-04-04 07:21:33.720999"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.725177"], ["updated_at", "2019-04-04 07:21:33.725177"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 181], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:21:33.732208"], ["id", 181]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 181], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.742238"], ["updated_at", "2019-04-04 07:21:33.742238"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.747043"], ["updated_at", "2019-04-04 07:21:33.747043"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 183], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:21:33.754213"], ["id", 183]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.763065"], ["updated_at", "2019-04-04 07:21:33.763065"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.768086"], ["updated_at", "2019-04-04 07:21:33.768086"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 185], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:21:33.774802"], ["id", 185]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.782730"], ["updated_at", "2019-04-04 07:21:33.782730"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:21:33.789611"], ["updated_at", "2019-04-04 07:21:33.789611"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.799611"], ["updated_at", "2019-04-04 07:21:33.799611"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:21:33.806463"], ["updated_at", "2019-04-04 07:21:33.806463"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.815375"], ["updated_at", "2019-04-04 07:21:33.815375"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:21:33.821438"], ["updated_at", "2019-04-04 07:21:33.821438"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:33.830340"], ["updated_at", "2019-04-04 07:21:33.830340"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:21:33.842407"], ["updated_at", "2019-04-04 07:21:33.842407"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:33.897294"], ["updated_at", "2019-04-04 07:21:33.897294"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:21:33.960237"], ["updated_at", "2019-04-04 07:21:33.960237"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 5.9ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:21:33.971591"], ["updated_at", "2019-04-04 07:21:33.971591"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.4ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:21:33.983812"], ["updated_at", "2019-04-04 07:21:33.983812"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.8ms)  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:21:33.994710"], ["updated_at", "2019-04-04 07:21:33.994710"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:34.005556"], ["updated_at", "2019-04-04 07:21:34.005556"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:21:34.011424"], ["updated_at", "2019-04-04 07:21:34.011424"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:34.070723"], ["updated_at", "2019-04-04 07:21:34.070723"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:34.097656"], ["updated_at", "2019-04-04 07:21:34.097656"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:34.112650"], ["updated_at", "2019-04-04 07:21:34.112650"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:34.137143"], ["updated_at", "2019-04-04 07:21:34.137143"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:34.153022"], ["updated_at", "2019-04-04 07:21:34.153022"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:21:34.179326"], ["updated_at", "2019-04-04 07:21:34.179326"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.5ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:11.998733"], ["updated_at", "2019-04-04 07:22:11.998733"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448931"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:12.018652"], ["updated_at", "2019-04-04 07:22:12.018652"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276132"]]  (1.9ms) COMMIT  (1.1ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 199], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:12.026978"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535332"], ["id", 199]]  (1.9ms) COMMIT Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (1.0ms) BEGIN Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 199]]  (1.8ms) COMMIT  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:12.044625"], ["updated_at", "2019-04-04 07:22:12.044625"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:22:12.057638"], ["updated_at", "2019-04-04 07:22:12.057638"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:22:12.062024"], ["synced_id", 0], ["id", 201]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:12.093324"], ["updated_at", "2019-04-04 07:22:12.093324"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.105259"], ["updated_at", "2019-04-04 07:22:12.105259"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.112083"], ["updated_at", "2019-04-04 07:22:12.112083"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 204], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:12.120929"], ["id", 204]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 204], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.133716"], ["updated_at", "2019-04-04 07:22:12.133716"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.138304"], ["updated_at", "2019-04-04 07:22:12.138304"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 206], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:12.144558"], ["id", 206]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 206], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.156137"], ["updated_at", "2019-04-04 07:22:12.156137"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.162867"], ["updated_at", "2019-04-04 07:22:12.162867"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 208], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:12.170179"], ["id", 208]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.179634"], ["updated_at", "2019-04-04 07:22:12.179634"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.184611"], ["updated_at", "2019-04-04 07:22:12.184611"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 210], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:12.190524"], ["id", 210]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.199685"], ["updated_at", "2019-04-04 07:22:12.199685"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:12.209461"], ["updated_at", "2019-04-04 07:22:12.209461"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.223006"], ["updated_at", "2019-04-04 07:22:12.223006"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:12.232020"], ["updated_at", "2019-04-04 07:22:12.232020"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.240051"], ["updated_at", "2019-04-04 07:22:12.240051"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:12.246458"], ["updated_at", "2019-04-04 07:22:12.246458"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.254640"], ["updated_at", "2019-04-04 07:22:12.254640"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:12.260779"], ["updated_at", "2019-04-04 07:22:12.260779"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.268707"], ["updated_at", "2019-04-04 07:22:12.268707"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 219], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:12.275223"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 219]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 219], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:12.296099"], ["updated_at", "2019-04-04 07:22:12.296099"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:12.305074"], ["updated_at", "2019-04-04 07:22:12.305074"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:12.312938"], ["updated_at", "2019-04-04 07:22:12.312938"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:12.317742"], ["updated_at", "2019-04-04 07:22:12.317742"], ["synced_id", 2]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:12.322487"], ["updated_at", "2019-04-04 07:22:12.322487"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.337292"], ["updated_at", "2019-04-04 07:22:12.337292"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.341899"], ["updated_at", "2019-04-04 07:22:12.341899"], ["synced_id", 123], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:12.367705"], ["updated_at", "2019-04-04 07:22:12.367705"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.423022"], ["updated_at", "2019-04-04 07:22:12.423022"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.445085"], ["updated_at", "2019-04-04 07:22:12.445085"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.473878"], ["updated_at", "2019-04-04 07:22:12.473878"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.509759"], ["updated_at", "2019-04-04 07:22:12.509759"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.539046"], ["updated_at", "2019-04-04 07:22:12.539046"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.583830"], ["updated_at", "2019-04-04 07:22:12.583830"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.604487"], ["updated_at", "2019-04-04 07:22:12.604487"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:12.649572"], ["updated_at", "2019-04-04 07:22:12.649572"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 4.6ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:12.660979"], ["updated_at", "2019-04-04 07:22:12.660979"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.8ms)  (1.4ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:12.677652"], ["updated_at", "2019-04-04 07:22:12.677652"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.9ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.710153"], ["updated_at", "2019-04-04 07:22:12.710153"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.717184"], ["updated_at", "2019-04-04 07:22:12.717184"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.722880"], ["updated_at", "2019-04-04 07:22:12.722880"], ["synced_id", 1], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.728729"], ["updated_at", "2019-04-04 07:22:12.728729"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:22:12.740061"], ["updated_at", "2019-04-04 07:22:12.740061"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448932"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:22:12.747302"], ["updated_at", "2019-04-04 07:22:12.747302"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276132"], ["host", "example.test"]]  (1.5ms) COMMIT  (0.7ms) BEGIN MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 231], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:12.753755"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535332"], ["id", 231]]  (1.5ms) COMMIT MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) BEGIN MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 231]]  (1.6ms) COMMIT  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.767488"], ["updated_at", "2019-04-04 07:22:12.767488"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.784970"], ["updated_at", "2019-04-04 07:22:12.784970"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.792289"], ["updated_at", "2019-04-04 07:22:12.792289"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:12.805084"], ["updated_at", "2019-04-04 07:22:12.805084"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 234], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:12.809724"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 234]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 234], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.820524"], ["updated_at", "2019-04-04 07:22:12.820524"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.827767"], ["updated_at", "2019-04-04 07:22:12.827767"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:12.839929"], ["updated_at", "2019-04-04 07:22:12.839929"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.848276"], ["updated_at", "2019-04-04 07:22:12.848276"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.857039"], ["updated_at", "2019-04-04 07:22:12.857039"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:12.867804"], ["updated_at", "2019-04-04 07:22:12.867804"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.878278"], ["updated_at", "2019-04-04 07:22:12.878278"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.885576"], ["updated_at", "2019-04-04 07:22:12.885576"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 238], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:12.892643"], ["id", 238]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.901356"], ["updated_at", "2019-04-04 07:22:12.901356"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.907066"], ["updated_at", "2019-04-04 07:22:12.907066"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 240], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:12.914117"], ["id", 240]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 240], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.923853"], ["updated_at", "2019-04-04 07:22:12.923853"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.928530"], ["updated_at", "2019-04-04 07:22:12.928530"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 242], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:12.935727"], ["id", 242]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 242], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.945571"], ["updated_at", "2019-04-04 07:22:12.945571"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.951700"], ["updated_at", "2019-04-04 07:22:12.951700"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:12.959635"], ["updated_at", "2019-04-04 07:22:12.959635"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:12.970326"], ["updated_at", "2019-04-04 07:22:12.970326"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.975381"], ["updated_at", "2019-04-04 07:22:12.975381"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:12.984377"], ["updated_at", "2019-04-04 07:22:12.984377"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:12.988802"], ["updated_at", "2019-04-04 07:22:12.988802"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:12.999229"], ["updated_at", "2019-04-04 07:22:12.999229"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:13.004283"], ["updated_at", "2019-04-04 07:22:13.004283"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:13.012785"], ["updated_at", "2019-04-04 07:22:13.012785"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:13.019555"], ["updated_at", "2019-04-04 07:22:13.019555"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.440245"], ["updated_at", "2019-04-04 07:22:57.440245"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.447048"], ["updated_at", "2019-04-04 07:22:57.447048"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 255], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:57.460447"], ["id", 255]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.472435"], ["updated_at", "2019-04-04 07:22:57.472435"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.479116"], ["updated_at", "2019-04-04 07:22:57.479116"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 257], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:57.494364"], ["id", 257]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 257], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.510048"], ["updated_at", "2019-04-04 07:22:57.510048"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.516457"], ["updated_at", "2019-04-04 07:22:57.516457"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 259], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:57.523915"], ["id", 259]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 259], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.537269"], ["updated_at", "2019-04-04 07:22:57.537269"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.542433"], ["updated_at", "2019-04-04 07:22:57.542433"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:57.553644"], ["updated_at", "2019-04-04 07:22:57.553644"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:57.566525"], ["updated_at", "2019-04-04 07:22:57.566525"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.571980"], ["updated_at", "2019-04-04 07:22:57.571980"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:57.581951"], ["updated_at", "2019-04-04 07:22:57.581951"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.586637"], ["updated_at", "2019-04-04 07:22:57.586637"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:22:57.595806"], ["updated_at", "2019-04-04 07:22:57.595806"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.601408"], ["updated_at", "2019-04-04 07:22:57.601408"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.614857"], ["updated_at", "2019-04-04 07:22:57.614857"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.621958"], ["updated_at", "2019-04-04 07:22:57.621958"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:22:57.651366"], ["updated_at", "2019-04-04 07:22:57.651366"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276177"], ["host", "example.test"]]  (7.8ms) COMMIT  (1.1ms) BEGIN MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 272], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:57.665629"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535377"], ["id", 272]]  (2.2ms) COMMIT MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) BEGIN MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 272]]  (1.8ms) COMMIT  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:22:57.682203"], ["updated_at", "2019-04-04 07:22:57.682203"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448977"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:57.691615"], ["updated_at", "2019-04-04 07:22:57.691615"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.710025"], ["updated_at", "2019-04-04 07:22:57.710025"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:57.722984"], ["updated_at", "2019-04-04 07:22:57.722984"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 275], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:57.728084"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 275]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 275], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.738363"], ["updated_at", "2019-04-04 07:22:57.738363"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:57.759749"], ["updated_at", "2019-04-04 07:22:57.759749"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.767202"], ["updated_at", "2019-04-04 07:22:57.767202"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.775451"], ["updated_at", "2019-04-04 07:22:57.775451"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:57.784513"], ["updated_at", "2019-04-04 07:22:57.784513"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:57.793577"], ["updated_at", "2019-04-04 07:22:57.793577"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:57.798678"], ["updated_at", "2019-04-04 07:22:57.798678"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:57.803463"], ["updated_at", "2019-04-04 07:22:57.803463"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:57.809608"], ["updated_at", "2019-04-04 07:22:57.809608"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:57.820492"], ["updated_at", "2019-04-04 07:22:57.820492"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.827517"], ["updated_at", "2019-04-04 07:22:57.827517"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.869152"], ["updated_at", "2019-04-04 07:22:57.869152"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.898927"], ["updated_at", "2019-04-04 07:22:57.898927"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.920500"], ["updated_at", "2019-04-04 07:22:57.920500"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.935247"], ["updated_at", "2019-04-04 07:22:57.935247"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.957652"], ["updated_at", "2019-04-04 07:22:57.957652"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.3ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.975240"], ["updated_at", "2019-04-04 07:22:57.975240"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:57.994922"], ["updated_at", "2019-04-04 07:22:57.994922"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.006370"], ["updated_at", "2019-04-04 07:22:58.006370"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.010973"], ["updated_at", "2019-04-04 07:22:58.010973"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:58.056652"], ["updated_at", "2019-04-04 07:22:58.056652"], ["synced_id", 123]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.6ms) BEGIN  (1.3ms) ROLLBACK  (1.2ms) BEGIN Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:58.083507"], ["updated_at", "2019-04-04 07:22:58.083507"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554276178"]]  (5.2ms) COMMIT  (1.9ms) BEGIN Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 229], ["LIMIT", 1]] Account Update (1.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:58.098975"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554535378"], ["id", 229]]  (3.6ms) COMMIT Account Load (1.4ms) SELECT "accounts".* FROM "accounts"  (1.0ms) BEGIN Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 229]]  (1.9ms) COMMIT  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:58.119784"], ["updated_at", "2019-04-04 07:22:58.119784"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554448978"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (1.5ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:58.143238"], ["updated_at", "2019-04-04 07:22:58.143238"], ["synced_id", 123]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.6ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:58.162334"], ["updated_at", "2019-04-04 07:22:58.162334"], ["synced_id", 1]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (2.4ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:58.175093"], ["updated_at", "2019-04-04 07:22:58.175093"], ["synced_id", 2]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:58.183054"], ["updated_at", "2019-04-04 07:22:58.183054"], ["synced_id", 3]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.196446"], ["updated_at", "2019-04-04 07:22:58.196446"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.202999"], ["updated_at", "2019-04-04 07:22:58.202999"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 236], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:58.212438"], ["id", 236]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.222152"], ["updated_at", "2019-04-04 07:22:58.222152"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.226647"], ["updated_at", "2019-04-04 07:22:58.226647"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 238], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:58.233005"], ["id", 238]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 238], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.242632"], ["updated_at", "2019-04-04 07:22:58.242632"], ["provider", "bookingsync"], ["synced_id", 456]]  (4.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.252043"], ["updated_at", "2019-04-04 07:22:58.252043"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 240], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:58.259222"], ["id", 240]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 240], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.269562"], ["updated_at", "2019-04-04 07:22:58.269562"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.274293"], ["updated_at", "2019-04-04 07:22:58.274293"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 242], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:22:58.280325"], ["id", 242]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.287989"], ["updated_at", "2019-04-04 07:22:58.287989"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:58.295777"], ["updated_at", "2019-04-04 07:22:58.295777"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.305746"], ["updated_at", "2019-04-04 07:22:58.305746"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:58.311965"], ["updated_at", "2019-04-04 07:22:58.311965"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.321493"], ["updated_at", "2019-04-04 07:22:58.321493"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:58.327601"], ["updated_at", "2019-04-04 07:22:58.327601"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:22:58.336491"], ["updated_at", "2019-04-04 07:22:58.336491"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:58.343036"], ["updated_at", "2019-04-04 07:22:58.343036"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:22:58.356963"], ["updated_at", "2019-04-04 07:22:58.356963"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:22:58.360539"], ["synced_id", 0], ["id", 251]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:58.377467"], ["updated_at", "2019-04-04 07:22:58.377467"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:22:58.394167"], ["updated_at", "2019-04-04 07:22:58.394167"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:22:58.406713"], ["updated_at", "2019-04-04 07:22:58.406713"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 253], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:22:58.413855"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 253]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 253], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:22:58.430686"], ["updated_at", "2019-04-04 07:22:58.430686"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (1.5ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:58.482893"], ["updated_at", "2019-04-04 07:22:58.482893"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.7ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:58.499316"], ["updated_at", "2019-04-04 07:22:58.499316"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.6ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:22:58.513294"], ["updated_at", "2019-04-04 07:22:58.513294"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.5ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.259317"], ["updated_at", "2019-04-04 07:37:19.259317"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.265489"], ["updated_at", "2019-04-04 07:37:19.265489"], ["synced_id", 123], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:37:19.305305"], ["updated_at", "2019-04-04 07:37:19.305305"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.5ms) ROLLBACK  (1.7ms) BEGIN  (1.9ms) ROLLBACK  (2.2ms) BEGIN  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:37:19.417012"], ["updated_at", "2019-04-04 07:37:19.417012"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 11ms (ActiveRecord: 6.5ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:37:19.434668"], ["updated_at", "2019-04-04 07:37:19.434668"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.8ms)  (2.0ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:37:19.452987"], ["updated_at", "2019-04-04 07:37:19.452987"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 6.7ms)  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.482300"], ["updated_at", "2019-04-04 07:37:19.482300"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.500457"], ["updated_at", "2019-04-04 07:37:19.500457"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.536203"], ["updated_at", "2019-04-04 07:37:19.536203"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.552041"], ["updated_at", "2019-04-04 07:37:19.552041"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.566699"], ["updated_at", "2019-04-04 07:37:19.566699"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.592197"], ["updated_at", "2019-04-04 07:37:19.592197"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.608263"], ["updated_at", "2019-04-04 07:37:19.608263"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:37:19.636544"], ["updated_at", "2019-04-04 07:37:19.636544"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:37:19.640176"], ["synced_id", 0], ["id", 262]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:37:19.652572"], ["updated_at", "2019-04-04 07:37:19.652572"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:37:19.657346"], ["updated_at", "2019-04-04 07:37:19.657346"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:37:19.661784"], ["updated_at", "2019-04-04 07:37:19.661784"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:37:19.671271"], ["updated_at", "2019-04-04 07:37:19.671271"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:37:19.681763"], ["updated_at", "2019-04-04 07:37:19.681763"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (2.6ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:37:19.696285"], ["updated_at", "2019-04-04 07:37:19.696285"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:37:19.711233"], ["updated_at", "2019-04-04 07:37:19.711233"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.725998"], ["updated_at", "2019-04-04 07:37:19.725998"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:37:19.742958"], ["updated_at", "2019-04-04 07:37:19.742958"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.755740"], ["updated_at", "2019-04-04 07:37:19.755740"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:37:19.764237"], ["updated_at", "2019-04-04 07:37:19.764237"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.774918"], ["updated_at", "2019-04-04 07:37:19.774918"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:37:19.782810"], ["updated_at", "2019-04-04 07:37:19.782810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.791756"], ["updated_at", "2019-04-04 07:37:19.791756"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:37:19.798249"], ["updated_at", "2019-04-04 07:37:19.798249"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.807893"], ["updated_at", "2019-04-04 07:37:19.807893"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.813042"], ["updated_at", "2019-04-04 07:37:19.813042"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 278], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:37:19.822062"], ["id", 278]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.835399"], ["updated_at", "2019-04-04 07:37:19.835399"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.841295"], ["updated_at", "2019-04-04 07:37:19.841295"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 280], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:37:19.849066"], ["id", 280]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 280], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.860682"], ["updated_at", "2019-04-04 07:37:19.860682"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.866482"], ["updated_at", "2019-04-04 07:37:19.866482"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 282], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:37:19.873640"], ["id", 282]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 282], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.885933"], ["updated_at", "2019-04-04 07:37:19.885933"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:19.893229"], ["updated_at", "2019-04-04 07:37:19.893229"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 284], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:37:19.906420"], ["id", 284]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:19.918043"], ["updated_at", "2019-04-04 07:37:19.918043"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 285], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:37:19.923550"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 285]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 285], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:37:19.943368"], ["updated_at", "2019-04-04 07:37:19.943368"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554449839"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:37:19.950583"], ["updated_at", "2019-04-04 07:37:19.950583"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554277039"]]  (1.7ms) COMMIT  (0.6ms) BEGIN Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 287], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:37:19.957363"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554536239"], ["id", 287]]  (1.5ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.6ms) BEGIN Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 287]]  (1.5ms) COMMIT  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.012363"], ["updated_at", "2019-04-04 07:37:20.012363"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.030416"], ["updated_at", "2019-04-04 07:37:20.030416"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.035477"], ["updated_at", "2019-04-04 07:37:20.035477"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.045013"], ["updated_at", "2019-04-04 07:37:20.045013"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.050280"], ["updated_at", "2019-04-04 07:37:20.050280"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 293], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:37:20.057917"], ["id", 293]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.066646"], ["updated_at", "2019-04-04 07:37:20.066646"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.071654"], ["updated_at", "2019-04-04 07:37:20.071654"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 295], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:37:20.079255"], ["id", 295]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 295], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.089816"], ["updated_at", "2019-04-04 07:37:20.089816"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.094969"], ["updated_at", "2019-04-04 07:37:20.094969"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 297], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:37:20.103084"], ["id", 297]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 297], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.113510"], ["updated_at", "2019-04-04 07:37:20.113510"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.119523"], ["updated_at", "2019-04-04 07:37:20.119523"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:37:20.127951"], ["updated_at", "2019-04-04 07:37:20.127951"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:37:20.138962"], ["updated_at", "2019-04-04 07:37:20.138962"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.143208"], ["updated_at", "2019-04-04 07:37:20.143208"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:37:20.152600"], ["updated_at", "2019-04-04 07:37:20.152600"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.156869"], ["updated_at", "2019-04-04 07:37:20.156869"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:37:20.166246"], ["updated_at", "2019-04-04 07:37:20.166246"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.171654"], ["updated_at", "2019-04-04 07:37:20.171654"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:37:20.179584"], ["updated_at", "2019-04-04 07:37:20.179584"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554449840"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:37:20.188815"], ["updated_at", "2019-04-04 07:37:20.188815"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554277040"], ["host", "example.test"]]  (1.7ms) COMMIT  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 309], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:37:20.196537"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554536240"], ["id", 309]]  (2.0ms) COMMIT MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) BEGIN MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 309]]  (1.9ms) COMMIT  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:20.212346"], ["updated_at", "2019-04-04 07:37:20.212346"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.221470"], ["updated_at", "2019-04-04 07:37:20.221470"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:20.233824"], ["updated_at", "2019-04-04 07:37:20.233824"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.242008"], ["updated_at", "2019-04-04 07:37:20.242008"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.248770"], ["updated_at", "2019-04-04 07:37:20.248770"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:37:20.258215"], ["updated_at", "2019-04-04 07:37:20.258215"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 312], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:37:20.264104"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 312]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 312], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:37:20.275504"], ["updated_at", "2019-04-04 07:37:20.275504"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:20.285399"], ["updated_at", "2019-04-04 07:37:20.285399"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:37:20.293313"], ["updated_at", "2019-04-04 07:37:20.293313"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:20.310180"], ["updated_at", "2019-04-04 07:37:20.310180"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:20.316196"], ["updated_at", "2019-04-04 07:37:20.316196"], ["synced_id", 2], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:20.324319"], ["updated_at", "2019-04-04 07:37:20.324319"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:20.330472"], ["updated_at", "2019-04-04 07:37:20.330472"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:32.494044"], ["updated_at", "2019-04-04 07:37:32.494044"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:37:32.501665"], ["updated_at", "2019-04-04 07:37:32.501665"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (3.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:47:59.153745"], ["updated_at", "2019-04-04 07:47:59.153745"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:47:59.160675"], ["updated_at", "2019-04-04 07:47:59.160675"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.6ms) ROLLBACK  (2.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:53:10.958928"], ["updated_at", "2019-04-04 07:53:10.958928"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:53:10.965666"], ["updated_at", "2019-04-04 07:53:10.965666"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.3ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:53:39.944591"], ["updated_at", "2019-04-04 07:53:39.944591"], ["synced_id", 123], ["host", "example.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:53:39.952235"], ["updated_at", "2019-04-04 07:53:39.952235"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:53:59.546540"], ["updated_at", "2019-04-04 07:53:59.546540"], ["synced_id", 123], ["host", "example.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:53:59.554004"], ["updated_at", "2019-04-04 07:53:59.554004"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.5ms) DROP DATABASE IF EXISTS "test"  (303.9ms) CREATE DATABASE "test" ENCODING = 'unicode' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "accounts" CASCADE  (9.2ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)  (3.0ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" ("synced_id")  (0.8ms) DROP TABLE IF EXISTS "applications" CASCADE  (5.3ms) CREATE TABLE "applications" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "host" character varying NOT NULL, "client_id" text NOT NULL, "client_secret" text NOT NULL)  (3.1ms) CREATE UNIQUE INDEX "index_applications_on_client_id" ON "applications" ("client_id")  (2.9ms) CREATE UNIQUE INDEX "index_applications_on_client_secret" ON "applications" ("client_secret")  (3.0ms) CREATE UNIQUE INDEX "index_applications_on_host" ON "applications" ("host")  (0.9ms) DROP TABLE IF EXISTS "multi_applications_accounts" CASCADE  (5.8ms) CREATE TABLE "multi_applications_accounts" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying, "host" character varying NOT NULL)  (3.4ms) CREATE UNIQUE INDEX "index_multi_applications_accounts_on_host_and_synced_id" ON "multi_applications_accounts" ("host", "synced_id")  (3.2ms) CREATE INDEX "index_multi_applications_accounts_on_host" ON "multi_applications_accounts" ("host")  (3.2ms) CREATE INDEX "index_multi_applications_accounts_on_synced_id" ON "multi_applications_accounts" ("synced_id")  (5.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20181130063104)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454), (20181130062650), (20181130063056), (20140522110326), (20181130062531);   (5.3ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.2ms) BEGIN ActiveRecord::InternalMetadata Create (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2019-04-04 07:54:37.209537"], ["updated_at", "2019-04-04 07:54:37.209537"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.8ms) COMMIT  (1.2ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.6ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:54:39.251908"], ["updated_at", "2019-04-04 07:54:39.251908"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 35ms (ActiveRecord: 11.9ms)  (0.8ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:54:39.268148"], ["updated_at", "2019-04-04 07:54:39.268148"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 12ms (ActiveRecord: 8.1ms)  (1.5ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:54:39.285358"], ["updated_at", "2019-04-04 07:54:39.285358"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.2ms)  (1.0ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.308823"], ["updated_at", "2019-04-04 07:54:39.308823"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:54:39.315833"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 4]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:54:39.329183"], ["updated_at", "2019-04-04 07:54:39.329183"], ["synced_id", 1]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:54:39.337500"], ["updated_at", "2019-04-04 07:54:39.337500"], ["synced_id", 2]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:54:39.345271"], ["updated_at", "2019-04-04 07:54:39.345271"], ["synced_id", 3]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.360772"], ["updated_at", "2019-04-04 07:54:39.360772"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:54:39.372646"], ["updated_at", "2019-04-04 07:54:39.372646"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.383159"], ["updated_at", "2019-04-04 07:54:39.383159"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:54:39.389979"], ["updated_at", "2019-04-04 07:54:39.389979"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.399703"], ["updated_at", "2019-04-04 07:54:39.399703"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:54:39.408575"], ["updated_at", "2019-04-04 07:54:39.408575"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.417732"], ["updated_at", "2019-04-04 07:54:39.417732"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 07:54:39.425277"], ["updated_at", "2019-04-04 07:54:39.425277"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.437561"], ["updated_at", "2019-04-04 07:54:39.437561"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.443094"], ["updated_at", "2019-04-04 07:54:39.443094"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 17], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:54:39.450370"], ["id", 17]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 17], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.461727"], ["updated_at", "2019-04-04 07:54:39.461727"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.466504"], ["updated_at", "2019-04-04 07:54:39.466504"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 19], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:54:39.472658"], ["id", 19]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.481806"], ["updated_at", "2019-04-04 07:54:39.481806"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.486338"], ["updated_at", "2019-04-04 07:54:39.486338"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 21], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:54:39.492707"], ["id", 21]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.500749"], ["updated_at", "2019-04-04 07:54:39.500749"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.505465"], ["updated_at", "2019-04-04 07:54:39.505465"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 23], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:54:39.511989"], ["id", 23]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 07:54:39.524922"], ["updated_at", "2019-04-04 07:54:39.524922"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 07:54:39.529028"], ["synced_id", 0], ["id", 24]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:54:39.554015"], ["updated_at", "2019-04-04 07:54:39.554015"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:54:39.566740"], ["updated_at", "2019-04-04 07:54:39.566740"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:54:39.578059"], ["updated_at", "2019-04-04 07:54:39.578059"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:54:39.587020"], ["updated_at", "2019-04-04 07:54:39.587020"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554450879"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:54:39.595545"], ["updated_at", "2019-04-04 07:54:39.595545"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554278079"]]  (7.4ms) COMMIT  (1.0ms) BEGIN Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 29], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 07:54:39.609266"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554537279"], ["id", 29]]  (1.8ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.8ms) BEGIN Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 29]]  (1.4ms) COMMIT  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:54:39.635831"], ["updated_at", "2019-04-04 07:54:39.635831"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.645128"], ["updated_at", "2019-04-04 07:54:39.645128"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:39.649130"], ["updated_at", "2019-04-04 07:54:39.649130"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 07:54:39.669764"], ["updated_at", "2019-04-04 07:54:39.669764"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.3ms) BEGIN  (2.0ms) ROLLBACK  (1.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (2.2ms) ROLLBACK  (1.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (1.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (1.4ms) BEGIN  (2.3ms) ROLLBACK  (1.4ms) BEGIN  (2.6ms) ROLLBACK  (1.8ms) BEGIN  (2.4ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (3.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.781993"], ["updated_at", "2019-04-04 07:54:39.781993"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.813938"], ["updated_at", "2019-04-04 07:54:39.813938"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.845969"], ["updated_at", "2019-04-04 07:54:39.845969"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.872515"], ["updated_at", "2019-04-04 07:54:39.872515"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.889928"], ["updated_at", "2019-04-04 07:54:39.889928"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.911453"], ["updated_at", "2019-04-04 07:54:39.911453"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.940551"], ["updated_at", "2019-04-04 07:54:39.940551"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:39.951908"], ["updated_at", "2019-04-04 07:54:39.951908"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:54:39.973068"], ["updated_at", "2019-04-04 07:54:39.973068"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 5], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:54:39.979025"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 5]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 5], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:54:39.991720"], ["updated_at", "2019-04-04 07:54:39.991720"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554278079"], ["host", "example.test"]]  (7.2ms) COMMIT  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 6], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 07:54:40.004293"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554537280"], ["id", 6]]  (1.6ms) COMMIT MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) BEGIN MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 6]]  (1.5ms) COMMIT  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 07:54:40.017631"], ["updated_at", "2019-04-04 07:54:40.017631"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554450880"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:40.025454"], ["updated_at", "2019-04-04 07:54:40.025454"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.032475"], ["updated_at", "2019-04-04 07:54:40.032475"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.043604"], ["updated_at", "2019-04-04 07:54:40.043604"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.048739"], ["updated_at", "2019-04-04 07:54:40.048739"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:54:40.058174"], ["updated_at", "2019-04-04 07:54:40.058174"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:54:40.069561"], ["updated_at", "2019-04-04 07:54:40.069561"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.075832"], ["updated_at", "2019-04-04 07:54:40.075832"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:54:40.087143"], ["updated_at", "2019-04-04 07:54:40.087143"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.093791"], ["updated_at", "2019-04-04 07:54:40.093791"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 07:54:40.106069"], ["updated_at", "2019-04-04 07:54:40.106069"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.111727"], ["updated_at", "2019-04-04 07:54:40.111727"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.121709"], ["updated_at", "2019-04-04 07:54:40.121709"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.127546"], ["updated_at", "2019-04-04 07:54:40.127546"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 18], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:54:40.134563"], ["id", 18]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.143816"], ["updated_at", "2019-04-04 07:54:40.143816"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.148575"], ["updated_at", "2019-04-04 07:54:40.148575"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 20], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:54:40.155016"], ["id", 20]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.164619"], ["updated_at", "2019-04-04 07:54:40.164619"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.169520"], ["updated_at", "2019-04-04 07:54:40.169520"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 22], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 07:54:40.177544"], ["id", 22]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.190158"], ["updated_at", "2019-04-04 07:54:40.190158"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.195752"], ["updated_at", "2019-04-04 07:54:40.195752"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 07:54:40.212809"], ["updated_at", "2019-04-04 07:54:40.212809"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:40.222390"], ["updated_at", "2019-04-04 07:54:40.222390"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.230336"], ["updated_at", "2019-04-04 07:54:40.230336"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:40.240697"], ["updated_at", "2019-04-04 07:54:40.240697"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.247888"], ["updated_at", "2019-04-04 07:54:40.247888"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 07:54:40.254787"], ["updated_at", "2019-04-04 07:54:40.254787"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:40.268164"], ["updated_at", "2019-04-04 07:54:40.268164"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:40.273853"], ["updated_at", "2019-04-04 07:54:40.273853"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:40.278817"], ["updated_at", "2019-04-04 07:54:40.278817"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 07:54:40.283366"], ["updated_at", "2019-04-04 07:54:40.283366"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:00:29.885709"], ["updated_at", "2019-04-04 08:00:29.885709"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:00:29.891443"], ["updated_at", "2019-04-04 08:00:29.891443"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:00:59.423764"], ["updated_at", "2019-04-04 08:00:59.423764"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:00:59.430141"], ["updated_at", "2019-04-04 08:00:59.430141"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:02:00.684713"], ["updated_at", "2019-04-04 08:02:00.684713"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:02:00.689946"], ["updated_at", "2019-04-04 08:02:00.689946"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:02:32.694938"], ["updated_at", "2019-04-04 08:02:32.694938"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:02:32.701490"], ["updated_at", "2019-04-04 08:02:32.701490"], ["synced_id", 123], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:03:03.643734"], ["updated_at", "2019-04-04 08:03:03.643734"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:03:03.649517"], ["updated_at", "2019-04-04 08:03:03.649517"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (3.3ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:03:19.520549"], ["updated_at", "2019-04-04 08:03:19.520549"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:03:19.526073"], ["updated_at", "2019-04-04 08:03:19.526073"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:03:39.497261"], ["updated_at", "2019-04-04 08:03:39.497261"], ["synced_id", 123], ["host", "example.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:03:39.505698"], ["updated_at", "2019-04-04 08:03:39.505698"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:04:04.245759"], ["updated_at", "2019-04-04 08:04:04.245759"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:04:04.252464"], ["updated_at", "2019-04-04 08:04:04.252464"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:07:01.951595"], ["updated_at", "2019-04-04 08:07:01.951595"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:07:01.958303"], ["updated_at", "2019-04-04 08:07:01.958303"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:07:18.575536"], ["updated_at", "2019-04-04 08:07:18.575536"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.6ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:07:18.611628"], ["updated_at", "2019-04-04 08:07:18.611628"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:07:18.616556"], ["updated_at", "2019-04-04 08:07:18.616556"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:08:12.799629"], ["updated_at", "2019-04-04 08:08:12.799629"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.0ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:08:12.837054"], ["updated_at", "2019-04-04 08:08:12.837054"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:08:12.844077"], ["updated_at", "2019-04-04 08:08:12.844077"], ["synced_id", 123], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:30:14.521919"], ["updated_at", "2019-04-04 08:30:14.521919"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:30:14.548524"], ["updated_at", "2019-04-04 08:30:14.548524"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:30:14.555444"], ["updated_at", "2019-04-04 08:30:14.555444"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:30:48.789562"], ["updated_at", "2019-04-04 08:30:48.789562"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:30:48.796927"], ["updated_at", "2019-04-04 08:30:48.796927"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:30:48.823681"], ["updated_at", "2019-04-04 08:30:48.823681"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:34:31.198906"], ["updated_at", "2019-04-04 08:34:31.198906"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:34:31.205167"], ["updated_at", "2019-04-04 08:34:31.205167"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:34:31.228848"], ["updated_at", "2019-04-04 08:34:31.228848"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:36:36.731452"], ["updated_at", "2019-04-04 08:36:36.731452"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:36:36.737560"], ["updated_at", "2019-04-04 08:36:36.737560"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:36:36.797549"], ["updated_at", "2019-04-04 08:36:36.797549"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:37:19.305431"], ["updated_at", "2019-04-04 08:37:19.305431"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:37:19.311803"], ["updated_at", "2019-04-04 08:37:19.311803"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:37:19.342299"], ["updated_at", "2019-04-04 08:37:19.342299"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:38:18.303140"], ["updated_at", "2019-04-04 08:38:18.303140"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:38:18.309699"], ["updated_at", "2019-04-04 08:38:18.309699"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:38:18.341124"], ["updated_at", "2019-04-04 08:38:18.341124"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:41:34.083193"], ["updated_at", "2019-04-04 08:41:34.083193"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:41:34.135415"], ["updated_at", "2019-04-04 08:41:34.135415"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:41:34.142542"], ["updated_at", "2019-04-04 08:41:34.142542"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:44:51.646665"], ["updated_at", "2019-04-04 08:44:51.646665"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:44:51.653089"], ["updated_at", "2019-04-04 08:44:51.653089"], ["synced_id", 123], ["host", "test.host"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 Account Exists (3.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:44:51.701588"], ["updated_at", "2019-04-04 08:44:51.701588"], ["synced_id", 123]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.7ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:45:24.509684"], ["updated_at", "2019-04-04 08:45:24.509684"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:45:24.546083"], ["updated_at", "2019-04-04 08:45:24.546083"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:45:24.552760"], ["updated_at", "2019-04-04 08:45:24.552760"], ["synced_id", 123], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:46:09.569407"], ["updated_at", "2019-04-04 08:46:09.569407"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:46:09.598979"], ["updated_at", "2019-04-04 08:46:09.598979"], ["synced_id", 123], ["host", "example.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:46:09.607879"], ["updated_at", "2019-04-04 08:46:09.607879"], ["synced_id", 123], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (3.1ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:47:00.872976"], ["updated_at", "2019-04-04 08:47:00.872976"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:47:00.879368"], ["updated_at", "2019-04-04 08:47:00.879368"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:47:00.924781"], ["updated_at", "2019-04-04 08:47:00.924781"], ["synced_id", 123]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Account Load (3.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.8ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:59:39.960558"], ["updated_at", "2019-04-04 08:59:39.960558"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 08:59:39.967296"], ["updated_at", "2019-04-04 08:59:39.967296"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 08:59:39.997254"], ["updated_at", "2019-04-04 08:59:39.997254"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (5.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:10:31.208310"], ["updated_at", "2019-04-04 09:10:31.208310"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (4.0ms) BEGIN  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:10:31.275271"], ["updated_at", "2019-04-04 09:10:31.275271"], ["synced_id", 123], ["host", "example.host"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:10:31.288486"], ["updated_at", "2019-04-04 09:10:31.288486"], ["synced_id", 123], ["host", "test.host"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (6.2ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:14.553490"], ["updated_at", "2019-04-04 09:11:14.553490"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:14.585742"], ["updated_at", "2019-04-04 09:11:14.585742"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:14.590962"], ["updated_at", "2019-04-04 09:11:14.590962"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) ROLLBACK  (3.7ms) BEGIN  (1.8ms) ROLLBACK  (1.5ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:21.536968"], ["updated_at", "2019-04-04 09:11:21.536968"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:21.564925"], ["updated_at", "2019-04-04 09:11:21.564925"], ["synced_id", 1]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:21.571149"], ["updated_at", "2019-04-04 09:11:21.571149"], ["synced_id", 2]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:21.576421"], ["updated_at", "2019-04-04 09:11:21.576421"], ["synced_id", 3]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:21.607439"], ["updated_at", "2019-04-04 09:11:21.607439"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:21.628424"], ["updated_at", "2019-04-04 09:11:21.628424"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 51], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:11:21.636183"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 51]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 51], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.1ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:21.648200"], ["updated_at", "2019-04-04 09:11:21.648200"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282681"]]  (1.9ms) COMMIT  (0.8ms) BEGIN Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 52], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:11:21.655662"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554541881"], ["id", 52]]  (1.7ms) COMMIT Account Load (2.4ms) SELECT "accounts".* FROM "accounts"  (1.3ms) BEGIN Account Destroy (1.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 52]]  (2.0ms) COMMIT  (1.4ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:21.676614"], ["updated_at", "2019-04-04 09:11:21.676614"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455481"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:21.691574"], ["updated_at", "2019-04-04 09:11:21.691574"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.702793"], ["updated_at", "2019-04-04 09:11:21.702793"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:21.721310"], ["updated_at", "2019-04-04 09:11:21.721310"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SELECT COUNT(*) FROM "accounts"  (1.7ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.739413"], ["updated_at", "2019-04-04 09:11:21.739413"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:21.748552"], ["updated_at", "2019-04-04 09:11:21.748552"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.759794"], ["updated_at", "2019-04-04 09:11:21.759794"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:21.769014"], ["updated_at", "2019-04-04 09:11:21.769014"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (2.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.781295"], ["updated_at", "2019-04-04 09:11:21.781295"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:21.789772"], ["updated_at", "2019-04-04 09:11:21.789772"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.806261"], ["updated_at", "2019-04-04 09:11:21.806261"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.812377"], ["updated_at", "2019-04-04 09:11:21.812377"], ["provider", "bookingsync"], ["synced_id", 123]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 64], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:21.821578"], ["id", 64]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.830851"], ["updated_at", "2019-04-04 09:11:21.830851"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.837063"], ["updated_at", "2019-04-04 09:11:21.837063"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 66], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:21.846759"], ["id", 66]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.857388"], ["updated_at", "2019-04-04 09:11:21.857388"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.862900"], ["updated_at", "2019-04-04 09:11:21.862900"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 68], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:21.872364"], ["id", 68]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 68], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.882001"], ["updated_at", "2019-04-04 09:11:21.882001"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:21.887723"], ["updated_at", "2019-04-04 09:11:21.887723"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 70], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:21.893849"], ["id", 70]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 70], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:11:21.909496"], ["updated_at", "2019-04-04 09:11:21.909496"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:11:21.914458"], ["synced_id", 0], ["id", 71]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:21.936150"], ["updated_at", "2019-04-04 09:11:21.936150"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:21.972827"], ["updated_at", "2019-04-04 09:11:21.972827"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (3.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 9.4ms)  (1.6ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:21.993667"], ["updated_at", "2019-04-04 09:11:21.993667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 8.5ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:22.012265"], ["updated_at", "2019-04-04 09:11:22.012265"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 13ms (ActiveRecord: 8.1ms)  (1.2ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 13ms (Views: 9.8ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.062566"], ["updated_at", "2019-04-04 09:11:22.062566"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (2.0ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.093406"], ["updated_at", "2019-04-04 09:11:22.093406"], ["synced_id", 1], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.104318"], ["updated_at", "2019-04-04 09:11:22.104318"], ["synced_id", 2], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.112210"], ["updated_at", "2019-04-04 09:11:22.112210"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.118311"], ["updated_at", "2019-04-04 09:11:22.118311"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:22.129550"], ["updated_at", "2019-04-04 09:11:22.129550"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 89], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:11:22.137620"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 89]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 89], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.150629"], ["updated_at", "2019-04-04 09:11:22.150629"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.157056"], ["updated_at", "2019-04-04 09:11:22.157056"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:22.168957"], ["updated_at", "2019-04-04 09:11:22.168957"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:22.181566"], ["updated_at", "2019-04-04 09:11:22.181566"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.188086"], ["updated_at", "2019-04-04 09:11:22.188086"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.2ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:22.203113"], ["updated_at", "2019-04-04 09:11:22.203113"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.209044"], ["updated_at", "2019-04-04 09:11:22.209044"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (2.9ms) BEGIN MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:22.222904"], ["updated_at", "2019-04-04 09:11:22.222904"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.229529"], ["updated_at", "2019-04-04 09:11:22.229529"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.241765"], ["updated_at", "2019-04-04 09:11:22.241765"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.250102"], ["updated_at", "2019-04-04 09:11:22.250102"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 99], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:22.258268"], ["id", 99]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.271599"], ["updated_at", "2019-04-04 09:11:22.271599"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.277686"], ["updated_at", "2019-04-04 09:11:22.277686"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 101], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:22.287693"], ["id", 101]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 101], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.299877"], ["updated_at", "2019-04-04 09:11:22.299877"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.306127"], ["updated_at", "2019-04-04 09:11:22.306127"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 103], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:22.317012"], ["id", 103]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 103], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.329172"], ["updated_at", "2019-04-04 09:11:22.329172"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.337260"], ["updated_at", "2019-04-04 09:11:22.337260"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.353836"], ["updated_at", "2019-04-04 09:11:22.353836"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.373920"], ["updated_at", "2019-04-04 09:11:22.373920"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.386937"], ["updated_at", "2019-04-04 09:11:22.386937"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.395309"], ["updated_at", "2019-04-04 09:11:22.395309"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:22.408074"], ["updated_at", "2019-04-04 09:11:22.408074"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:11:22.418764"], ["updated_at", "2019-04-04 09:11:22.418764"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282682"], ["host", "example.test"]]  (3.7ms) COMMIT  (1.7ms) BEGIN MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 110], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:11:22.432182"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554541882"], ["id", 110]]  (2.6ms) COMMIT MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.2ms) BEGIN MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 110]]  (2.2ms) COMMIT  (1.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:11:22.452873"], ["updated_at", "2019-04-04 09:11:22.452873"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455482"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.466744"], ["updated_at", "2019-04-04 09:11:22.466744"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.481638"], ["updated_at", "2019-04-04 09:11:22.481638"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.491517"], ["updated_at", "2019-04-04 09:11:22.491517"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.504830"], ["updated_at", "2019-04-04 09:11:22.504830"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.524377"], ["updated_at", "2019-04-04 09:11:22.524377"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.557250"], ["updated_at", "2019-04-04 09:11:22.557250"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.586094"], ["updated_at", "2019-04-04 09:11:22.586094"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.608486"], ["updated_at", "2019-04-04 09:11:22.608486"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.637343"], ["updated_at", "2019-04-04 09:11:22.637343"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (3.2ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:22.662550"], ["updated_at", "2019-04-04 09:11:22.662550"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.679430"], ["updated_at", "2019-04-04 09:11:22.679430"], ["synced_id", 123], ["host", "example.host"]]  (2.8ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:22.692730"], ["updated_at", "2019-04-04 09:11:22.692730"], ["synced_id", 123], ["host", "test.host"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) ROLLBACK  (1.5ms) BEGIN  (1.0ms) ROLLBACK  (1.7ms) BEGIN  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:22.743087"], ["updated_at", "2019-04-04 09:11:22.743087"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (2.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:59.018846"], ["updated_at", "2019-04-04 09:11:59.018846"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.3ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.059865"], ["updated_at", "2019-04-04 09:11:59.059865"], ["synced_id", 123], ["host", "example.host"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.068767"], ["updated_at", "2019-04-04 09:11:59.068767"], ["synced_id", 123], ["host", "test.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (3.2ms) ROLLBACK  (1.5ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.094954"], ["updated_at", "2019-04-04 09:11:59.094954"], ["synced_id", 123], ["host", "test.example"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.128396"], ["updated_at", "2019-04-04 09:11:59.128396"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.137545"], ["updated_at", "2019-04-04 09:11:59.137545"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.165211"], ["updated_at", "2019-04-04 09:11:59.165211"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.171538"], ["updated_at", "2019-04-04 09:11:59.171538"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.177254"], ["updated_at", "2019-04-04 09:11:59.177254"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.182689"], ["updated_at", "2019-04-04 09:11:59.182689"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.192462"], ["updated_at", "2019-04-04 09:11:59.192462"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.199613"], ["updated_at", "2019-04-04 09:11:59.199613"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.210963"], ["updated_at", "2019-04-04 09:11:59.210963"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.218227"], ["updated_at", "2019-04-04 09:11:59.218227"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:59.233093"], ["updated_at", "2019-04-04 09:11:59.233093"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.0ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:59.249228"], ["updated_at", "2019-04-04 09:11:59.249228"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.255186"], ["updated_at", "2019-04-04 09:11:59.255186"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:59.267666"], ["updated_at", "2019-04-04 09:11:59.267666"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.273316"], ["updated_at", "2019-04-04 09:11:59.273316"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.6ms) BEGIN MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:11:59.286528"], ["updated_at", "2019-04-04 09:11:59.286528"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.292486"], ["updated_at", "2019-04-04 09:11:59.292486"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.306687"], ["updated_at", "2019-04-04 09:11:59.306687"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.313564"], ["updated_at", "2019-04-04 09:11:59.313564"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 133], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:59.322537"], ["id", 133]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.5ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.336995"], ["updated_at", "2019-04-04 09:11:59.336995"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.343627"], ["updated_at", "2019-04-04 09:11:59.343627"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 135], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:59.353875"], ["id", 135]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 135], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.366220"], ["updated_at", "2019-04-04 09:11:59.366220"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.371368"], ["updated_at", "2019-04-04 09:11:59.371368"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 137], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:59.378790"], ["id", 137]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 137], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.393651"], ["updated_at", "2019-04-04 09:11:59.393651"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.406683"], ["updated_at", "2019-04-04 09:11:59.406683"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.419764"], ["updated_at", "2019-04-04 09:11:59.419764"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.428221"], ["updated_at", "2019-04-04 09:11:59.428221"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:59.441932"], ["updated_at", "2019-04-04 09:11:59.441932"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 141], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:11:59.449615"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 141]]  (2.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 141], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.4ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:11:59.464562"], ["updated_at", "2019-04-04 09:11:59.464562"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282719"], ["host", "example.test"]]  (7.6ms) COMMIT  (0.9ms) BEGIN MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 142], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:11:59.479987"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554541919"], ["id", 142]]  (1.7ms) COMMIT MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) BEGIN MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 142]]  (1.5ms) COMMIT  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:11:59.496506"], ["updated_at", "2019-04-04 09:11:59.496506"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455519"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.5ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:59.509041"], ["updated_at", "2019-04-04 09:11:59.509041"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:11:59.522667"], ["updated_at", "2019-04-04 09:11:59.522667"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (2.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:59.574367"], ["updated_at", "2019-04-04 09:11:59.574367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 11ms (ActiveRecord: 5.8ms)  (1.2ms) ROLLBACK  (2.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:59.595079"], ["updated_at", "2019-04-04 09:11:59.595079"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.4ms)  (0.9ms) ROLLBACK  (2.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:59.614383"], ["updated_at", "2019-04-04 09:11:59.614383"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 8.5ms)  (1.5ms) ROLLBACK  (1.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 7.9ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (1.4ms) BEGIN Account Load (1.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:11:59.687147"], ["updated_at", "2019-04-04 09:11:59.687147"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:11:59.692306"], ["synced_id", 0], ["id", 81]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.706429"], ["updated_at", "2019-04-04 09:11:59.706429"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (2.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:59.717410"], ["updated_at", "2019-04-04 09:11:59.717410"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.730978"], ["updated_at", "2019-04-04 09:11:59.730978"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:59.742013"], ["updated_at", "2019-04-04 09:11:59.742013"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.753571"], ["updated_at", "2019-04-04 09:11:59.753571"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:59.760922"], ["updated_at", "2019-04-04 09:11:59.760922"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.772641"], ["updated_at", "2019-04-04 09:11:59.772641"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:11:59.781816"], ["updated_at", "2019-04-04 09:11:59.781816"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.803249"], ["updated_at", "2019-04-04 09:11:59.803249"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.809935"], ["updated_at", "2019-04-04 09:11:59.809935"], ["provider", "bookingsync"], ["synced_id", 123]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 91], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:59.819775"], ["id", 91]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.5ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (5.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.832316"], ["updated_at", "2019-04-04 09:11:59.832316"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.845867"], ["updated_at", "2019-04-04 09:11:59.845867"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 93], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:59.854533"], ["id", 93]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.863546"], ["updated_at", "2019-04-04 09:11:59.863546"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.868012"], ["updated_at", "2019-04-04 09:11:59.868012"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 95], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:59.873511"], ["id", 95]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 95], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.887146"], ["updated_at", "2019-04-04 09:11:59.887146"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:11:59.893034"], ["updated_at", "2019-04-04 09:11:59.893034"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 97], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:11:59.903878"], ["id", 97]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 97], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:59.916504"], ["updated_at", "2019-04-04 09:11:59.916504"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282719"]]  (3.5ms) COMMIT  (0.9ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 98], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:11:59.925770"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554541919"], ["id", 98]]  (3.5ms) COMMIT Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN Account Destroy (1.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 98]]  (1.7ms) COMMIT  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:59.944743"], ["updated_at", "2019-04-04 09:11:59.944743"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455519"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:11:59.959678"], ["updated_at", "2019-04-04 09:11:59.959678"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (2.6ms) BEGIN  (1.2ms) ROLLBACK  (1.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:59.981548"], ["updated_at", "2019-04-04 09:11:59.981548"], ["synced_id", 123]]  (3.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.6ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:11:59.997731"], ["updated_at", "2019-04-04 09:11:59.997731"], ["synced_id", 123]]  (3.2ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.5ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:00.014114"], ["updated_at", "2019-04-04 09:12:00.014114"], ["synced_id", 1]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:00.023230"], ["updated_at", "2019-04-04 09:12:00.023230"], ["synced_id", 2]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:00.030454"], ["updated_at", "2019-04-04 09:12:00.030454"], ["synced_id", 3]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:00.043368"], ["updated_at", "2019-04-04 09:12:00.043368"], ["synced_id", 123]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.060895"], ["updated_at", "2019-04-04 09:12:00.060895"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (3.0ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 106], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:12:00.070990"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 106]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 106], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.089062"], ["updated_at", "2019-04-04 09:12:00.089062"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.116786"], ["updated_at", "2019-04-04 09:12:00.116786"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.151013"], ["updated_at", "2019-04-04 09:12:00.151013"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.182893"], ["updated_at", "2019-04-04 09:12:00.182893"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.212015"], ["updated_at", "2019-04-04 09:12:00.212015"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.236067"], ["updated_at", "2019-04-04 09:12:00.236067"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (2.1ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:00.257268"], ["updated_at", "2019-04-04 09:12:00.257268"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (2.1ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.4ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:12:16.018177"], ["updated_at", "2019-04-04 09:12:16.018177"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 49ms (ActiveRecord: 16.8ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:12:16.034359"], ["updated_at", "2019-04-04 09:12:16.034359"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.7ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:12:16.049708"], ["updated_at", "2019-04-04 09:12:16.049708"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 11ms (ActiveRecord: 7.1ms)  (1.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.088380"], ["updated_at", "2019-04-04 09:12:16.088380"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.095903"], ["updated_at", "2019-04-04 09:12:16.095903"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 111], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:12:16.107918"], ["id", 111]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.120122"], ["updated_at", "2019-04-04 09:12:16.120122"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.127629"], ["updated_at", "2019-04-04 09:12:16.127629"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 113], ["LIMIT", 1]] Account Update (1.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:12:16.134681"], ["id", 113]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 113], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.147725"], ["updated_at", "2019-04-04 09:12:16.147725"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.152821"], ["updated_at", "2019-04-04 09:12:16.152821"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 115], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:12:16.161592"], ["id", 115]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 115], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.172434"], ["updated_at", "2019-04-04 09:12:16.172434"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.177333"], ["updated_at", "2019-04-04 09:12:16.177333"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 117], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:12:16.182751"], ["id", 117]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (1.4ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.192472"], ["updated_at", "2019-04-04 09:12:16.192472"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:12:16.202689"], ["updated_at", "2019-04-04 09:12:16.202689"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "accounts"  (1.2ms) ROLLBACK  (2.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.220947"], ["updated_at", "2019-04-04 09:12:16.220947"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:12:16.231418"], ["updated_at", "2019-04-04 09:12:16.231418"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.244573"], ["updated_at", "2019-04-04 09:12:16.244573"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:12:16.253217"], ["updated_at", "2019-04-04 09:12:16.253217"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.263452"], ["updated_at", "2019-04-04 09:12:16.263452"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:12:16.272287"], ["updated_at", "2019-04-04 09:12:16.272287"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.285655"], ["updated_at", "2019-04-04 09:12:16.285655"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 126], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:12:16.292751"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 126]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Account Load (2.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 126], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:16.309106"], ["updated_at", "2019-04-04 09:12:16.309106"], ["synced_id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:16.314961"], ["updated_at", "2019-04-04 09:12:16.314961"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:16.321138"], ["updated_at", "2019-04-04 09:12:16.321138"], ["synced_id", 3]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:16.333309"], ["updated_at", "2019-04-04 09:12:16.333309"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN Account Load (1.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:12:16.352803"], ["updated_at", "2019-04-04 09:12:16.352803"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:12:16.358181"], ["synced_id", 0], ["id", 131]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:12:16.393025"], ["updated_at", "2019-04-04 09:12:16.393025"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:12:16.406576"], ["updated_at", "2019-04-04 09:12:16.406576"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455536"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.5ms) ROLLBACK  (1.1ms) BEGIN Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:12:16.420442"], ["updated_at", "2019-04-04 09:12:16.420442"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282736"]]  (4.0ms) COMMIT  (2.4ms) BEGIN Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 133], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:12:16.434276"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554541936"], ["id", 133]]  (2.6ms) COMMIT Account Load (1.3ms) SELECT "accounts".* FROM "accounts"  (1.0ms) BEGIN Account Destroy (1.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 133]]  (2.1ms) COMMIT  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:16.455863"], ["updated_at", "2019-04-04 09:12:16.455863"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:16.466924"], ["updated_at", "2019-04-04 09:12:16.466924"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.498507"], ["updated_at", "2019-04-04 09:12:16.498507"], ["synced_id", 123], ["host", "test.example"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.523182"], ["updated_at", "2019-04-04 09:12:16.523182"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.531620"], ["updated_at", "2019-04-04 09:12:16.531620"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.542333"], ["updated_at", "2019-04-04 09:12:16.542333"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.546687"], ["updated_at", "2019-04-04 09:12:16.546687"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (2.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.559364"], ["updated_at", "2019-04-04 09:12:16.559364"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.563703"], ["updated_at", "2019-04-04 09:12:16.563703"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 151], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:12:16.575470"], ["id", 151]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.590307"], ["updated_at", "2019-04-04 09:12:16.590307"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.598746"], ["updated_at", "2019-04-04 09:12:16.598746"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 153], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:12:16.608079"], ["id", 153]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 153], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.620449"], ["updated_at", "2019-04-04 09:12:16.620449"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.627833"], ["updated_at", "2019-04-04 09:12:16.627833"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 155], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:12:16.635681"], ["id", 155]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 155], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.647141"], ["updated_at", "2019-04-04 09:12:16.647141"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.652650"], ["updated_at", "2019-04-04 09:12:16.652650"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:12:16.668975"], ["updated_at", "2019-04-04 09:12:16.668975"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.3ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:12:16.684139"], ["updated_at", "2019-04-04 09:12:16.684139"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.692077"], ["updated_at", "2019-04-04 09:12:16.692077"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:12:16.704816"], ["updated_at", "2019-04-04 09:12:16.704816"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.711820"], ["updated_at", "2019-04-04 09:12:16.711820"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:12:16.725567"], ["updated_at", "2019-04-04 09:12:16.725567"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.732428"], ["updated_at", "2019-04-04 09:12:16.732428"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.743686"], ["updated_at", "2019-04-04 09:12:16.743686"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.752299"], ["updated_at", "2019-04-04 09:12:16.752299"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.5ms) BEGIN  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:12:16.776074"], ["updated_at", "2019-04-04 09:12:16.776074"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455536"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.2ms) BEGIN MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:12:16.788346"], ["updated_at", "2019-04-04 09:12:16.788346"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282736"], ["host", "example.test"]]  (7.9ms) COMMIT  (1.9ms) BEGIN MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 168], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:12:16.804711"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554541936"], ["id", 168]]  (2.7ms) COMMIT MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.0ms) BEGIN MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 168]]  (2.2ms) COMMIT  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:12:16.822137"], ["updated_at", "2019-04-04 09:12:16.822137"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 169], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:12:16.827060"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 169]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 169], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:12:16.836917"], ["updated_at", "2019-04-04 09:12:16.836917"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.847560"], ["updated_at", "2019-04-04 09:12:16.847560"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (2.3ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.871437"], ["updated_at", "2019-04-04 09:12:16.871437"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.884929"], ["updated_at", "2019-04-04 09:12:16.884929"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.898253"], ["updated_at", "2019-04-04 09:12:16.898253"], ["synced_id", 1], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.907464"], ["updated_at", "2019-04-04 09:12:16.907464"], ["synced_id", 2], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.913434"], ["updated_at", "2019-04-04 09:12:16.913434"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:16.918976"], ["updated_at", "2019-04-04 09:12:16.918976"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.934803"], ["updated_at", "2019-04-04 09:12:16.934803"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.964925"], ["updated_at", "2019-04-04 09:12:16.964925"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:16.994180"], ["updated_at", "2019-04-04 09:12:16.994180"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:17.022108"], ["updated_at", "2019-04-04 09:12:17.022108"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:17.044068"], ["updated_at", "2019-04-04 09:12:17.044068"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:17.064543"], ["updated_at", "2019-04-04 09:12:17.064543"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (2.1ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (8.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:17.100330"], ["updated_at", "2019-04-04 09:12:17.100330"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:12:17.107739"], ["updated_at", "2019-04-04 09:12:17.107739"], ["synced_id", 123], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (2.4ms) BEGIN  (2.5ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:12:17.129734"], ["updated_at", "2019-04-04 09:12:17.129734"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (2.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:12:17.149076"], ["updated_at", "2019-04-04 09:12:17.149076"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (2.6ms) RELEASE SAVEPOINT active_record_1 Application Load (3.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (2.4ms) ROLLBACK  (2.7ms) BEGIN  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.8ms) ROLLBACK  (1.7ms) BEGIN  (2.0ms) ROLLBACK  (1.4ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.275982"], ["updated_at", "2019-04-04 09:16:30.275982"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.323136"], ["updated_at", "2019-04-04 09:16:30.323136"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.329504"], ["updated_at", "2019-04-04 09:16:30.329504"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (2.5ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:16:30.359300"], ["updated_at", "2019-04-04 09:16:30.359300"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.3ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.381050"], ["updated_at", "2019-04-04 09:16:30.381050"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.392771"], ["updated_at", "2019-04-04 09:16:30.392771"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (4.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 181], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:16:30.412551"], ["id", 181]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.427335"], ["updated_at", "2019-04-04 09:16:30.427335"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.434430"], ["updated_at", "2019-04-04 09:16:30.434430"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 183], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:16:30.447851"], ["id", 183]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 183], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.465251"], ["updated_at", "2019-04-04 09:16:30.465251"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (3.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.476965"], ["updated_at", "2019-04-04 09:16:30.476965"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 185], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:16:30.487286"], ["id", 185]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 185], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.499363"], ["updated_at", "2019-04-04 09:16:30.499363"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.507213"], ["updated_at", "2019-04-04 09:16:30.507213"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:16:30.519427"], ["updated_at", "2019-04-04 09:16:30.519427"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:16:30.531971"], ["updated_at", "2019-04-04 09:16:30.531971"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.538170"], ["updated_at", "2019-04-04 09:16:30.538170"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:16:30.551077"], ["updated_at", "2019-04-04 09:16:30.551077"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.558358"], ["updated_at", "2019-04-04 09:16:30.558358"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:16:30.575006"], ["updated_at", "2019-04-04 09:16:30.575006"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.584276"], ["updated_at", "2019-04-04 09:16:30.584276"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.596341"], ["updated_at", "2019-04-04 09:16:30.596341"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.602881"], ["updated_at", "2019-04-04 09:16:30.602881"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.615944"], ["updated_at", "2019-04-04 09:16:30.615944"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.645786"], ["updated_at", "2019-04-04 09:16:30.645786"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.655999"], ["updated_at", "2019-04-04 09:16:30.655999"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.665362"], ["updated_at", "2019-04-04 09:16:30.665362"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.678272"], ["updated_at", "2019-04-04 09:16:30.678272"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.688779"], ["updated_at", "2019-04-04 09:16:30.688779"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (3.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:16:30.715717"], ["updated_at", "2019-04-04 09:16:30.715717"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.733042"], ["updated_at", "2019-04-04 09:16:30.733042"], ["synced_id", 1], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.741616"], ["updated_at", "2019-04-04 09:16:30.741616"], ["synced_id", 2], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.750386"], ["updated_at", "2019-04-04 09:16:30.750386"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.757919"], ["updated_at", "2019-04-04 09:16:30.757919"], ["synced_id", 2], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:16:30.770158"], ["updated_at", "2019-04-04 09:16:30.770158"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 206], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:16:30.775094"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 206]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 206], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:16:30.784489"], ["updated_at", "2019-04-04 09:16:30.784489"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282990"], ["host", "example.test"]]  (4.6ms) COMMIT  (1.0ms) BEGIN MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 207], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:16:30.796984"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554542190"], ["id", 207]]  (1.8ms) COMMIT MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.1ms) BEGIN MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 207]]  (1.8ms) COMMIT  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:16:30.813157"], ["updated_at", "2019-04-04 09:16:30.813157"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455790"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:30.823879"], ["updated_at", "2019-04-04 09:16:30.823879"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.832383"], ["updated_at", "2019-04-04 09:16:30.832383"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.4ms) BEGIN  (1.8ms) ROLLBACK  (1.1ms) BEGIN  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (2.0ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.2ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) ROLLBACK  (1.4ms) BEGIN  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (2.1ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (3.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.943419"], ["updated_at", "2019-04-04 09:16:30.943419"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (2.8ms) ROLLBACK  (1.2ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:30.979599"], ["updated_at", "2019-04-04 09:16:30.979599"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:31.001291"], ["updated_at", "2019-04-04 09:16:31.001291"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:31.032133"], ["updated_at", "2019-04-04 09:16:31.032133"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:31.054994"], ["updated_at", "2019-04-04 09:16:31.054994"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:31.090467"], ["updated_at", "2019-04-04 09:16:31.090467"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:16:31.121488"], ["updated_at", "2019-04-04 09:16:31.121488"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 7.4ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (22.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:16:31.161115"], ["updated_at", "2019-04-04 09:16:31.161115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 30ms (ActiveRecord: 26.6ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:16:31.173973"], ["updated_at", "2019-04-04 09:16:31.173973"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 4.1ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:16:31.218627"], ["updated_at", "2019-04-04 09:16:31.218627"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (223.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:16:31.234325"], ["updated_at", "2019-04-04 09:16:31.234325"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:16:31.464762"], ["updated_at", "2019-04-04 09:16:31.464762"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:16:31.475614"], ["updated_at", "2019-04-04 09:16:31.475614"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:16:31.479256"], ["synced_id", 0], ["id", 144]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:16:31.491836"], ["updated_at", "2019-04-04 09:16:31.491836"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:16:31.500579"], ["updated_at", "2019-04-04 09:16:31.500579"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554455791"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.8ms) BEGIN Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:16:31.513761"], ["updated_at", "2019-04-04 09:16:31.513761"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554282991"]]  (7.9ms) COMMIT  (2.2ms) BEGIN Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 146], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:16:31.531606"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554542191"], ["id", 146]]  (2.5ms) COMMIT Account Load (1.3ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 146]]  (1.9ms) COMMIT  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (1.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:16:31.555385"], ["updated_at", "2019-04-04 09:16:31.555385"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:16:31.560316"], ["updated_at", "2019-04-04 09:16:31.560316"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:16:31.565957"], ["updated_at", "2019-04-04 09:16:31.565957"], ["synced_id", 3]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (2.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.580913"], ["updated_at", "2019-04-04 09:16:31.580913"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:16:31.593025"], ["updated_at", "2019-04-04 09:16:31.593025"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.604852"], ["updated_at", "2019-04-04 09:16:31.604852"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:16:31.611284"], ["updated_at", "2019-04-04 09:16:31.611284"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.622680"], ["updated_at", "2019-04-04 09:16:31.622680"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:16:31.628667"], ["updated_at", "2019-04-04 09:16:31.628667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.638366"], ["updated_at", "2019-04-04 09:16:31.638366"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:16:31.648254"], ["updated_at", "2019-04-04 09:16:31.648254"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (2.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.664092"], ["updated_at", "2019-04-04 09:16:31.664092"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.671951"], ["updated_at", "2019-04-04 09:16:31.671951"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (2.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 159], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:16:31.682525"], ["id", 159]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.694262"], ["updated_at", "2019-04-04 09:16:31.694262"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.700807"], ["updated_at", "2019-04-04 09:16:31.700807"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 161], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:16:31.708971"], ["id", 161]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 161], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.722388"], ["updated_at", "2019-04-04 09:16:31.722388"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.729857"], ["updated_at", "2019-04-04 09:16:31.729857"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (2.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 163], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:16:31.740722"], ["id", 163]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 163], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.751985"], ["updated_at", "2019-04-04 09:16:31.751985"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:16:31.759017"], ["updated_at", "2019-04-04 09:16:31.759017"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 165], ["LIMIT", 1]] Account Update (1.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:16:31.767996"], ["id", 165]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:16:31.777656"], ["updated_at", "2019-04-04 09:16:31.777656"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 166], ["LIMIT", 1]] Account Update (1.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:16:31.784023"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 166]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 166], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:16.219669"], ["updated_at", "2019-04-04 09:44:16.219669"], ["synced_id", 123], ["host", "test.example"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SAVEPOINT active_record_1 Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.265087"], ["updated_at", "2019-04-04 09:44:16.265087"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:44:16.313046"], ["updated_at", "2019-04-04 09:44:16.313046"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457456"], ["host", "example.test"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (3.2ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Exists (2.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:44:16.343734"], ["updated_at", "2019-04-04 09:44:16.343734"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284656"], ["host", "example.test"]]  (3.5ms) COMMIT  (1.5ms) BEGIN MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 213], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (3.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:44:16.357374"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554543856"], ["id", 213]]  (3.4ms) COMMIT MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (2.5ms) BEGIN MultiApplicationsAccount Destroy (2.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 213]]  (3.1ms) COMMIT  (1.1ms) BEGIN  (1.2ms) ROLLBACK  (1.9ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (5.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.407075"], ["updated_at", "2019-04-04 09:44:16.407075"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (2.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (6.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.8ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:44:16.462568"], ["updated_at", "2019-04-04 09:44:16.462568"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.8ms) RELEASE SAVEPOINT active_record_1  (3.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 215], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:44:16.481499"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 215]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 215], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.2ms) BEGIN  (3.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (4.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:16.507510"], ["updated_at", "2019-04-04 09:44:16.507510"], ["synced_id", 123], ["host", "test.example"]]  (3.8ms) RELEASE SAVEPOINT active_record_1  (3.1ms) SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.535197"], ["updated_at", "2019-04-04 09:44:16.535197"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (3.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.553969"], ["updated_at", "2019-04-04 09:44:16.553969"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (3.6ms) RELEASE SAVEPOINT active_record_1 Application Load (2.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.6ms) BEGIN  (3.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (4.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:44:16.583384"], ["updated_at", "2019-04-04 09:44:16.583384"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (3.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:16.606959"], ["updated_at", "2019-04-04 09:44:16.606959"], ["synced_id", 1], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (4.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:16.618798"], ["updated_at", "2019-04-04 09:44:16.618798"], ["synced_id", 2], ["host", "example.test"]]  (4.3ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:16.637770"], ["updated_at", "2019-04-04 09:44:16.637770"], ["synced_id", 1], ["host", "example2.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:16.651858"], ["updated_at", "2019-04-04 09:44:16.651858"], ["synced_id", 2], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (3.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (5.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:16.677541"], ["updated_at", "2019-04-04 09:44:16.677541"], ["synced_id", 123], ["host", "test.example"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (3.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.698140"], ["updated_at", "2019-04-04 09:44:16.698140"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (3.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.724851"], ["updated_at", "2019-04-04 09:44:16.724851"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (3.8ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.741511"], ["updated_at", "2019-04-04 09:44:16.741511"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (4.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:44:16.769128"], ["updated_at", "2019-04-04 09:44:16.769128"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (2.9ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (2.8ms) ROLLBACK  (1.2ms) BEGIN MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:44:16.796692"], ["updated_at", "2019-04-04 09:44:16.796692"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.810261"], ["updated_at", "2019-04-04 09:44:16.810261"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.9ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (2.1ms) BEGIN MultiApplicationsAccount Load (2.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:44:16.839874"], ["updated_at", "2019-04-04 09:44:16.839874"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.852845"], ["updated_at", "2019-04-04 09:44:16.852845"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (3.4ms) ROLLBACK  (1.4ms) BEGIN MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (4.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:44:16.890266"], ["updated_at", "2019-04-04 09:44:16.890266"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (3.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.902726"], ["updated_at", "2019-04-04 09:44:16.902726"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (2.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.924761"], ["updated_at", "2019-04-04 09:44:16.924761"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (3.4ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.941789"], ["updated_at", "2019-04-04 09:44:16.941789"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 232], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:44:16.958983"], ["id", 232]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (2.2ms) ROLLBACK  (1.7ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (5.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:16.987550"], ["updated_at", "2019-04-04 09:44:16.987550"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (3.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.000855"], ["updated_at", "2019-04-04 09:44:17.000855"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 234], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:44:17.021930"], ["id", 234]]  (2.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 234], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.9ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.052383"], ["updated_at", "2019-04-04 09:44:17.052383"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (3.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.065138"], ["updated_at", "2019-04-04 09:44:17.065138"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 236], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:44:17.076205"], ["id", 236]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 236], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.091130"], ["updated_at", "2019-04-04 09:44:17.091130"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.098634"], ["updated_at", "2019-04-04 09:44:17.098634"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:17.145569"], ["updated_at", "2019-04-04 09:44:17.145569"], ["synced_id", 123], ["host", "example.host"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:17.153744"], ["updated_at", "2019-04-04 09:44:17.153744"], ["synced_id", 123], ["host", "test.host"]]  (2.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (3.9ms) ROLLBACK  (2.5ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:44:17.228715"], ["updated_at", "2019-04-04 09:44:17.228715"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (3.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.7ms) BEGIN  (2.1ms) ROLLBACK  (1.4ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Application Exists (5.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.284303"], ["updated_at", "2019-04-04 09:44:17.284303"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.5ms) RELEASE SAVEPOINT active_record_1 Application Load (4.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (3.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (3.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (2.8ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (4.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.361710"], ["updated_at", "2019-04-04 09:44:17.361710"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (4.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (2.1ms) ROLLBACK  (1.6ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Application Exists (4.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (4.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.422409"], ["updated_at", "2019-04-04 09:44:17.422409"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (3.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (3.1ms) ROLLBACK  (1.0ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Application Exists (3.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (4.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.473428"], ["updated_at", "2019-04-04 09:44:17.473428"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (3.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (4.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (3.9ms) ROLLBACK  (1.1ms) BEGIN  (3.6ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.541857"], ["updated_at", "2019-04-04 09:44:17.541857"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (5.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (22.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.622467"], ["updated_at", "2019-04-04 09:44:17.622467"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (4.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 11ms (Views: 9.7ms | ActiveRecord: 0.0ms)  (3.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (4.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 2ms (ActiveRecord: 0.0ms)  (2.6ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (2.3ms) ROLLBACK  (1.9ms) BEGIN  (3.5ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:17.746909"], ["updated_at", "2019-04-04 09:44:17.746909"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (3.6ms) RELEASE SAVEPOINT active_record_1 Application Load (2.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.8ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 21ms (Views: 14.1ms | ActiveRecord: 0.0ms)  (2.2ms) ROLLBACK  (2.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.8ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (2.6ms) ROLLBACK  (3.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.2ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:44:17.850415"], ["updated_at", "2019-04-04 09:44:17.850415"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (3.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 27ms (ActiveRecord: 14.7ms)  (2.3ms) ROLLBACK  (2.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (4.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:44:17.893346"], ["updated_at", "2019-04-04 09:44:17.893346"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 9.8ms)  (1.3ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (5.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.6ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:44:17.925638"], ["updated_at", "2019-04-04 09:44:17.925638"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 24ms (ActiveRecord: 13.8ms)  (1.8ms) ROLLBACK  (2.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 2ms (ActiveRecord: 0.0ms)  (4.2ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (2.1ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:44:17.985679"], ["updated_at", "2019-04-04 09:44:17.985679"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (3.2ms) ROLLBACK  (1.3ms) BEGIN Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:44:18.007733"], ["updated_at", "2019-04-04 09:44:18.007733"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284658"]]  (6.2ms) COMMIT  (1.0ms) BEGIN Account Exists (3.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 171], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:44:18.026209"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554543858"], ["id", 171]]  (2.6ms) COMMIT Account Load (1.4ms) SELECT "accounts".* FROM "accounts"  (1.8ms) BEGIN Account Destroy (2.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 171]]  (5.6ms) COMMIT  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:44:18.061941"], ["updated_at", "2019-04-04 09:44:18.061941"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457458"]]  (6.0ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (1.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:44:18.091057"], ["updated_at", "2019-04-04 09:44:18.091057"], ["synced_id", 123]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (5.3ms) ROLLBACK  (3.4ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (5.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:44:18.122566"], ["updated_at", "2019-04-04 09:44:18.122566"], ["synced_id", 1]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:44:18.137025"], ["updated_at", "2019-04-04 09:44:18.137025"], ["synced_id", 2]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (3.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:44:18.153279"], ["updated_at", "2019-04-04 09:44:18.153279"], ["synced_id", 3]]  (3.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.7ms) BEGIN  (3.0ms) ROLLBACK  (1.4ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (4.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.184255"], ["updated_at", "2019-04-04 09:44:18.184255"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SELECT COUNT(*) FROM "accounts" Account Load (3.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (4.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:44:18.207076"], ["updated_at", "2019-04-04 09:44:18.207076"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "accounts"  (2.0ms) ROLLBACK  (2.5ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (4.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.227469"], ["updated_at", "2019-04-04 09:44:18.227469"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (2.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Exists (4.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:44:18.249042"], ["updated_at", "2019-04-04 09:44:18.249042"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.9ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.272514"], ["updated_at", "2019-04-04 09:44:18.272514"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (5.6ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:44:18.291509"], ["updated_at", "2019-04-04 09:44:18.291509"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (3.1ms) ROLLBACK  (2.9ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.310486"], ["updated_at", "2019-04-04 09:44:18.310486"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.5ms) RELEASE SAVEPOINT active_record_1 Account Load (2.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:44:18.328715"], ["updated_at", "2019-04-04 09:44:18.328715"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (4.4ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.350298"], ["updated_at", "2019-04-04 09:44:18.350298"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (5.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.364728"], ["updated_at", "2019-04-04 09:44:18.364728"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.5ms) SAVEPOINT active_record_1 Account Exists (3.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 186], ["LIMIT", 1]] Account Update (3.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:44:18.385721"], ["id", 186]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (3.3ms) ROLLBACK  (1.4ms) BEGIN  (2.7ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.414779"], ["updated_at", "2019-04-04 09:44:18.414779"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.426308"], ["updated_at", "2019-04-04 09:44:18.426308"], ["provider", "bookingsync"], ["synced_id", 123]]  (2.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.2ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 188], ["LIMIT", 1]] Account Update (4.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:44:18.443697"], ["id", 188]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (3.0ms) ROLLBACK  (4.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.468567"], ["updated_at", "2019-04-04 09:44:18.468567"], ["provider", "bookingsync"], ["synced_id", 456]]  (3.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (3.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.481418"], ["updated_at", "2019-04-04 09:44:18.481418"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 190], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:44:18.499968"], ["id", 190]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (4.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 190], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (0.9ms) BEGIN  (2.8ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.527522"], ["updated_at", "2019-04-04 09:44:18.527522"], ["provider", "bookingsync"], ["synced_id", 456]]  (4.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:44:18.544307"], ["updated_at", "2019-04-04 09:44:18.544307"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.4ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 192], ["LIMIT", 1]] Account Update (3.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:44:18.562702"], ["id", 192]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 192], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (3.5ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:44:18.590142"], ["updated_at", "2019-04-04 09:44:18.590142"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (4.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Account Exists (4.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 193], ["LIMIT", 1]] Account Update (2.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:44:18.606656"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 193]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 193], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (3.0ms) BEGIN  (2.2ms) SAVEPOINT active_record_1 Account Exists (5.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:44:18.638916"], ["updated_at", "2019-04-04 09:44:18.638916"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (2.7ms) ROLLBACK  (1.6ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 Account Exists (4.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (5.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:44:18.666821"], ["updated_at", "2019-04-04 09:44:18.666821"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (1.4ms) BEGIN Account Load (2.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (4.5ms) SAVEPOINT active_record_1 Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:44:18.702405"], ["updated_at", "2019-04-04 09:44:18.702405"]]  (3.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Update (2.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:44:18.713512"], ["synced_id", 0], ["id", 196]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (2.5ms) ROLLBACK  (2.0ms) BEGIN  (1.9ms) ROLLBACK  (1.6ms) BEGIN  (1.8ms) ROLLBACK  (1.7ms) BEGIN  (2.7ms) ROLLBACK  (3.8ms) BEGIN  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.540423"], ["updated_at", "2019-04-04 09:45:27.540423"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:27.584931"], ["updated_at", "2019-04-04 09:45:27.584931"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:27.593157"], ["updated_at", "2019-04-04 09:45:27.593157"], ["synced_id", 2], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:27.600298"], ["updated_at", "2019-04-04 09:45:27.600298"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:27.606271"], ["updated_at", "2019-04-04 09:45:27.606271"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:27.617780"], ["updated_at", "2019-04-04 09:45:27.617780"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.625032"], ["updated_at", "2019-04-04 09:45:27.625032"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:45:27.638714"], ["updated_at", "2019-04-04 09:45:27.638714"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457527"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:45:27.647992"], ["updated_at", "2019-04-04 09:45:27.647992"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284727"], ["host", "example.test"]]  (4.0ms) COMMIT  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 249], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:45:27.658636"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554543927"], ["id", 249]]  (2.2ms) COMMIT MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.1ms) BEGIN MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 249]]  (1.8ms) COMMIT  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.675642"], ["updated_at", "2019-04-04 09:45:27.675642"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.683434"], ["updated_at", "2019-04-04 09:45:27.683434"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:45:27.694638"], ["updated_at", "2019-04-04 09:45:27.694638"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:45:27.705200"], ["updated_at", "2019-04-04 09:45:27.705200"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.709759"], ["updated_at", "2019-04-04 09:45:27.709759"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:45:27.720670"], ["updated_at", "2019-04-04 09:45:27.720670"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.724416"], ["updated_at", "2019-04-04 09:45:27.724416"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:45:27.737573"], ["updated_at", "2019-04-04 09:45:27.737573"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.742914"], ["updated_at", "2019-04-04 09:45:27.742914"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.754906"], ["updated_at", "2019-04-04 09:45:27.754906"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.760714"], ["updated_at", "2019-04-04 09:45:27.760714"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 259], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:45:27.770298"], ["id", 259]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.780912"], ["updated_at", "2019-04-04 09:45:27.780912"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.787567"], ["updated_at", "2019-04-04 09:45:27.787567"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 261], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:45:27.793831"], ["id", 261]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 261], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.803216"], ["updated_at", "2019-04-04 09:45:27.803216"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.809698"], ["updated_at", "2019-04-04 09:45:27.809698"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 263], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (3.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:45:27.826459"], ["id", 263]]  (2.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 263], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.847004"], ["updated_at", "2019-04-04 09:45:27.847004"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.855920"], ["updated_at", "2019-04-04 09:45:27.855920"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:45:27.868376"], ["updated_at", "2019-04-04 09:45:27.868376"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.878422"], ["updated_at", "2019-04-04 09:45:27.878422"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:27.902958"], ["updated_at", "2019-04-04 09:45:27.902958"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.910822"], ["updated_at", "2019-04-04 09:45:27.910822"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.921208"], ["updated_at", "2019-04-04 09:45:27.921208"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:45:27.930970"], ["updated_at", "2019-04-04 09:45:27.930970"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 270], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:45:27.935809"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 270]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 270], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:27.944412"], ["updated_at", "2019-04-04 09:45:27.944412"], ["synced_id", 123], ["host", "test.example"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.955363"], ["updated_at", "2019-04-04 09:45:27.955363"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:27.978461"], ["updated_at", "2019-04-04 09:45:27.978461"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:28.001662"], ["updated_at", "2019-04-04 09:45:28.001662"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:28.026531"], ["updated_at", "2019-04-04 09:45:28.026531"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:28.047904"], ["updated_at", "2019-04-04 09:45:28.047904"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:28.072835"], ["updated_at", "2019-04-04 09:45:28.072835"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:28.091956"], ["updated_at", "2019-04-04 09:45:28.091956"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:45:28.130705"], ["updated_at", "2019-04-04 09:45:28.130705"], ["synced_id", 1]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:45:28.138817"], ["updated_at", "2019-04-04 09:45:28.138817"], ["synced_id", 2]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:45:28.147294"], ["updated_at", "2019-04-04 09:45:28.147294"], ["synced_id", 3]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:45:28.159028"], ["updated_at", "2019-04-04 09:45:28.159028"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:45:28.170077"], ["updated_at", "2019-04-04 09:45:28.170077"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457528"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.0ms) BEGIN Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:45:28.178896"], ["updated_at", "2019-04-04 09:45:28.178896"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284728"]]  (7.8ms) COMMIT  (1.1ms) BEGIN Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 202], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:45:28.193560"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554543928"], ["id", 202]]  (2.0ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 202]]  (1.9ms) COMMIT  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:45:28.209148"], ["updated_at", "2019-04-04 09:45:28.209148"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:45:28.235514"], ["updated_at", "2019-04-04 09:45:28.235514"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.2ms) BEGIN Account Load (1.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 Account Create (3.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:45:28.257671"], ["updated_at", "2019-04-04 09:45:28.257671"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Update (1.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:45:28.265303"], ["synced_id", 0], ["id", 205]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (2.2ms) ROLLBACK  (1.5ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:45:28.287782"], ["updated_at", "2019-04-04 09:45:28.287782"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.4ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.303323"], ["updated_at", "2019-04-04 09:45:28.303323"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT COUNT(*) FROM "accounts" Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.5ms) SAVEPOINT active_record_1 Account Exists (3.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:45:28.323888"], ["updated_at", "2019-04-04 09:45:28.323888"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (1.5ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.342720"], ["updated_at", "2019-04-04 09:45:28.342720"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.6ms) SAVEPOINT active_record_1 Account Exists (3.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:45:28.360167"], ["updated_at", "2019-04-04 09:45:28.360167"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.374259"], ["updated_at", "2019-04-04 09:45:28.374259"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:45:28.387438"], ["updated_at", "2019-04-04 09:45:28.387438"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.399999"], ["updated_at", "2019-04-04 09:45:28.399999"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:45:28.407112"], ["updated_at", "2019-04-04 09:45:28.407112"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (2.4ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.425218"], ["updated_at", "2019-04-04 09:45:28.425218"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.434246"], ["updated_at", "2019-04-04 09:45:28.434246"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 215], ["LIMIT", 1]] Account Update (2.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:45:28.443420"], ["id", 215]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.454086"], ["updated_at", "2019-04-04 09:45:28.454086"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.459281"], ["updated_at", "2019-04-04 09:45:28.459281"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 217], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:45:28.468525"], ["id", 217]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 217], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.480091"], ["updated_at", "2019-04-04 09:45:28.480091"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.484664"], ["updated_at", "2019-04-04 09:45:28.484664"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 219], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:45:28.490514"], ["id", 219]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 219], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.502430"], ["updated_at", "2019-04-04 09:45:28.502430"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.507200"], ["updated_at", "2019-04-04 09:45:28.507200"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 221], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:45:28.514502"], ["id", 221]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:45:28.524232"], ["updated_at", "2019-04-04 09:45:28.524232"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 222], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:45:28.529342"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 222]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 222], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:45:28.605318"], ["updated_at", "2019-04-04 09:45:28.605318"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 5.6ms)  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:45:28.621932"], ["updated_at", "2019-04-04 09:45:28.621932"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.6ms)  (1.1ms) SELECT COUNT(*) FROM "accounts"  (0.9ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:45:28.638069"], ["updated_at", "2019-04-04 09:45:28.638069"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.7ms)  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:45:28.649778"], ["updated_at", "2019-04-04 09:45:28.649778"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.661901"], ["updated_at", "2019-04-04 09:45:28.661901"], ["synced_id", 123], ["host", "example.host"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:45:28.669371"], ["updated_at", "2019-04-04 09:45:28.669371"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.4ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.782771"], ["updated_at", "2019-04-04 09:47:33.782771"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.791508"], ["updated_at", "2019-04-04 09:47:33.791508"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 228], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:47:33.802688"], ["id", 228]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 228], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.815366"], ["updated_at", "2019-04-04 09:47:33.815366"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.821996"], ["updated_at", "2019-04-04 09:47:33.821996"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 230], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:47:33.832505"], ["id", 230]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 230], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.847183"], ["updated_at", "2019-04-04 09:47:33.847183"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.852828"], ["updated_at", "2019-04-04 09:47:33.852828"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 232], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:47:33.860168"], ["id", 232]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.869535"], ["updated_at", "2019-04-04 09:47:33.869535"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.877412"], ["updated_at", "2019-04-04 09:47:33.877412"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 234], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:47:33.886650"], ["id", 234]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.897006"], ["updated_at", "2019-04-04 09:47:33.897006"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:33.910455"], ["updated_at", "2019-04-04 09:47:33.910455"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts"  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.923054"], ["updated_at", "2019-04-04 09:47:33.923054"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:33.932731"], ["updated_at", "2019-04-04 09:47:33.932731"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.943450"], ["updated_at", "2019-04-04 09:47:33.943450"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:33.953709"], ["updated_at", "2019-04-04 09:47:33.953709"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:33.964923"], ["updated_at", "2019-04-04 09:47:33.964923"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:33.976939"], ["updated_at", "2019-04-04 09:47:33.976939"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:47:33.989346"], ["updated_at", "2019-04-04 09:47:33.989346"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.2ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:47:34.024873"], ["updated_at", "2019-04-04 09:47:34.024873"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.038892"], ["updated_at", "2019-04-04 09:47:34.038892"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 244], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:47:34.046969"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 244]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 244], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.6ms) ROLLBACK  (2.2ms) BEGIN Account Load (1.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:47:34.080283"], ["updated_at", "2019-04-04 09:47:34.080283"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Update (1.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:47:34.085443"], ["synced_id", 0], ["id", 245]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:47:34.108009"], ["updated_at", "2019-04-04 09:47:34.108009"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:47:34.119107"], ["updated_at", "2019-04-04 09:47:34.119107"], ["synced_id", 1]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:47:34.127679"], ["updated_at", "2019-04-04 09:47:34.127679"], ["synced_id", 2]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:47:34.132293"], ["updated_at", "2019-04-04 09:47:34.132293"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:47:34.144355"], ["updated_at", "2019-04-04 09:47:34.144355"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457654"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:47:34.152374"], ["updated_at", "2019-04-04 09:47:34.152374"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284854"]]  (8.2ms) COMMIT  (1.2ms) BEGIN Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 251], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:47:34.168626"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544054"], ["id", 251]]  (2.3ms) COMMIT Account Load (1.4ms) SELECT "accounts".* FROM "accounts"  (1.1ms) BEGIN Account Destroy (1.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 251]]  (1.9ms) COMMIT  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:47:34.185504"], ["updated_at", "2019-04-04 09:47:34.185504"], ["synced_id", 123]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.7ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (1.7ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.4ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (2.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:47:34.268842"], ["updated_at", "2019-04-04 09:47:34.268842"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.284000"], ["updated_at", "2019-04-04 09:47:34.284000"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.292368"], ["updated_at", "2019-04-04 09:47:34.292368"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:47:34.307689"], ["updated_at", "2019-04-04 09:47:34.307689"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.2ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:47:34.325658"], ["updated_at", "2019-04-04 09:47:34.325658"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.331622"], ["updated_at", "2019-04-04 09:47:34.331622"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:47:34.343745"], ["updated_at", "2019-04-04 09:47:34.343745"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.350585"], ["updated_at", "2019-04-04 09:47:34.350585"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (3.2ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:47:34.365901"], ["updated_at", "2019-04-04 09:47:34.365901"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.374198"], ["updated_at", "2019-04-04 09:47:34.374198"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.389249"], ["updated_at", "2019-04-04 09:47:34.389249"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.400093"], ["updated_at", "2019-04-04 09:47:34.400093"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 286], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:47:34.411313"], ["id", 286]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.426130"], ["updated_at", "2019-04-04 09:47:34.426130"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.432019"], ["updated_at", "2019-04-04 09:47:34.432019"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 288], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:47:34.443147"], ["id", 288]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 288], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (2.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.458520"], ["updated_at", "2019-04-04 09:47:34.458520"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.466808"], ["updated_at", "2019-04-04 09:47:34.466808"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 290], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:47:34.477785"], ["id", 290]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 290], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.489860"], ["updated_at", "2019-04-04 09:47:34.489860"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.494799"], ["updated_at", "2019-04-04 09:47:34.494799"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:47:34.503571"], ["updated_at", "2019-04-04 09:47:34.503571"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284854"], ["host", "example.test"]]  (3.8ms) COMMIT  (1.1ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 294], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:47:34.515090"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544054"], ["id", 294]]  (1.8ms) COMMIT MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.0ms) BEGIN MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 294]]  (1.7ms) COMMIT  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:47:34.531128"], ["updated_at", "2019-04-04 09:47:34.531128"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457654"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.3ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:34.542111"], ["updated_at", "2019-04-04 09:47:34.542111"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.549453"], ["updated_at", "2019-04-04 09:47:34.549453"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:34.563186"], ["updated_at", "2019-04-04 09:47:34.563186"], ["synced_id", 1], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:34.572407"], ["updated_at", "2019-04-04 09:47:34.572407"], ["synced_id", 2], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:34.579455"], ["updated_at", "2019-04-04 09:47:34.579455"], ["synced_id", 1], ["host", "example2.test"]]  (2.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:34.588065"], ["updated_at", "2019-04-04 09:47:34.588065"], ["synced_id", 2], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.602132"], ["updated_at", "2019-04-04 09:47:34.602132"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:34.633731"], ["updated_at", "2019-04-04 09:47:34.633731"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.645047"], ["updated_at", "2019-04-04 09:47:34.645047"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:34.656721"], ["updated_at", "2019-04-04 09:47:34.656721"], ["synced_id", 123], ["host", "test.example"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.667753"], ["updated_at", "2019-04-04 09:47:34.667753"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.680563"], ["updated_at", "2019-04-04 09:47:34.680563"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:47:34.692949"], ["updated_at", "2019-04-04 09:47:34.692949"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 304], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:47:34.698871"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 304]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 304], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:34.716263"], ["updated_at", "2019-04-04 09:47:34.716263"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 5.9ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:34.734418"], ["updated_at", "2019-04-04 09:47:34.734418"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.9ms)  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.5ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:34.756444"], ["updated_at", "2019-04-04 09:47:34.756444"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 8.4ms)  (1.4ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (3.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:47:34.778981"], ["updated_at", "2019-04-04 09:47:34.778981"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 6.8ms)  (1.5ms) SELECT COUNT(*) FROM "accounts"  (2.3ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.837967"], ["updated_at", "2019-04-04 09:47:34.837967"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (4.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.877992"], ["updated_at", "2019-04-04 09:47:34.877992"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.909441"], ["updated_at", "2019-04-04 09:47:34.909441"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.937734"], ["updated_at", "2019-04-04 09:47:34.937734"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (2.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.960042"], ["updated_at", "2019-04-04 09:47:34.960042"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:34.979735"], ["updated_at", "2019-04-04 09:47:34.979735"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (3.0ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:35.029943"], ["updated_at", "2019-04-04 09:47:35.029943"], ["synced_id", 123], ["host", "example.host"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:47:35.038609"], ["updated_at", "2019-04-04 09:47:35.038609"], ["synced_id", 123], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:47:35.055183"], ["updated_at", "2019-04-04 09:47:35.055183"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (2.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:47:35.076197"], ["updated_at", "2019-04-04 09:47:35.076197"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (0.6ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:13.511800"], ["updated_at", "2019-04-04 09:48:13.511800"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 258], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:48:13.519525"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 258]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 258], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:48:13.532511"], ["updated_at", "2019-04-04 09:48:13.532511"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.4ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:48:13.546254"], ["updated_at", "2019-04-04 09:48:13.546254"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:48:13.552581"], ["synced_id", 0], ["id", 260]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:48:13.572332"], ["updated_at", "2019-04-04 09:48:13.572332"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457693"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.3ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:48:13.591968"], ["updated_at", "2019-04-04 09:48:13.591968"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284893"]]  (4.1ms) COMMIT  (1.1ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 262], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:48:13.602976"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544093"], ["id", 262]]  (2.0ms) COMMIT Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (1.4ms) BEGIN Account Destroy (2.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 262]]  (2.2ms) COMMIT  (0.8ms) BEGIN  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:48:13.648847"], ["updated_at", "2019-04-04 09:48:13.648847"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.5ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:48:13.661472"], ["updated_at", "2019-04-04 09:48:13.661472"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:48:13.671407"], ["updated_at", "2019-04-04 09:48:13.671407"], ["synced_id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:48:13.678770"], ["updated_at", "2019-04-04 09:48:13.678770"], ["synced_id", 2]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:48:13.686375"], ["updated_at", "2019-04-04 09:48:13.686375"], ["synced_id", 3]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.702729"], ["updated_at", "2019-04-04 09:48:13.702729"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.6ms) SELECT COUNT(*) FROM "accounts" Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:13.721899"], ["updated_at", "2019-04-04 09:48:13.721899"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "accounts"  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.735337"], ["updated_at", "2019-04-04 09:48:13.735337"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:13.742783"], ["updated_at", "2019-04-04 09:48:13.742783"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.753778"], ["updated_at", "2019-04-04 09:48:13.753778"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:13.761683"], ["updated_at", "2019-04-04 09:48:13.761683"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.772579"], ["updated_at", "2019-04-04 09:48:13.772579"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:13.783101"], ["updated_at", "2019-04-04 09:48:13.783101"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (2.3ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.796420"], ["updated_at", "2019-04-04 09:48:13.796420"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.802377"], ["updated_at", "2019-04-04 09:48:13.802377"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 276], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:48:13.811732"], ["id", 276]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.822912"], ["updated_at", "2019-04-04 09:48:13.822912"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.830953"], ["updated_at", "2019-04-04 09:48:13.830953"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 278], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:48:13.838042"], ["id", 278]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 278], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.849034"], ["updated_at", "2019-04-04 09:48:13.849034"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.854027"], ["updated_at", "2019-04-04 09:48:13.854027"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 280], ["LIMIT", 1]] Account Update (2.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:48:13.862383"], ["id", 280]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 280], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.874084"], ["updated_at", "2019-04-04 09:48:13.874084"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.880279"], ["updated_at", "2019-04-04 09:48:13.880279"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 282], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:48:13.889287"], ["id", 282]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:48:13.900417"], ["updated_at", "2019-04-04 09:48:13.900417"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.910735"], ["updated_at", "2019-04-04 09:48:13.910735"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.918279"], ["updated_at", "2019-04-04 09:48:13.918279"], ["synced_id", 2], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.925676"], ["updated_at", "2019-04-04 09:48:13.925676"], ["synced_id", 1], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:13.933281"], ["updated_at", "2019-04-04 09:48:13.933281"], ["synced_id", 2], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:13.947823"], ["updated_at", "2019-04-04 09:48:13.947823"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:13.969864"], ["updated_at", "2019-04-04 09:48:13.969864"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:13.975445"], ["updated_at", "2019-04-04 09:48:13.975445"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:13.986473"], ["updated_at", "2019-04-04 09:48:13.986473"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:13.995266"], ["updated_at", "2019-04-04 09:48:13.995266"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:48:14.009274"], ["updated_at", "2019-04-04 09:48:14.009274"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.2ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:48:14.023679"], ["updated_at", "2019-04-04 09:48:14.023679"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.031426"], ["updated_at", "2019-04-04 09:48:14.031426"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:48:14.043028"], ["updated_at", "2019-04-04 09:48:14.043028"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.049559"], ["updated_at", "2019-04-04 09:48:14.049559"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:48:14.062737"], ["updated_at", "2019-04-04 09:48:14.062737"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.068451"], ["updated_at", "2019-04-04 09:48:14.068451"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.077470"], ["updated_at", "2019-04-04 09:48:14.077470"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.083401"], ["updated_at", "2019-04-04 09:48:14.083401"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 324], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:48:14.093727"], ["id", 324]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.104645"], ["updated_at", "2019-04-04 09:48:14.104645"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.113481"], ["updated_at", "2019-04-04 09:48:14.113481"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 326], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:48:14.122765"], ["id", 326]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 326], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.138930"], ["updated_at", "2019-04-04 09:48:14.138930"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.144788"], ["updated_at", "2019-04-04 09:48:14.144788"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 328], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:48:14.153605"], ["id", 328]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 328], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:48:14.164081"], ["updated_at", "2019-04-04 09:48:14.164081"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 330], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:48:14.169359"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 330]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 330], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:14.180160"], ["updated_at", "2019-04-04 09:48:14.180160"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.199370"], ["updated_at", "2019-04-04 09:48:14.199370"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:48:14.213426"], ["updated_at", "2019-04-04 09:48:14.213426"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:48:14.222038"], ["updated_at", "2019-04-04 09:48:14.222038"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457694"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:48:14.230541"], ["updated_at", "2019-04-04 09:48:14.230541"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554284894"], ["host", "example.test"]]  (1.7ms) COMMIT  (0.7ms) BEGIN MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 334], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:48:14.237575"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544094"], ["id", 334]]  (2.7ms) COMMIT MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) BEGIN MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 334]]  (1.9ms) COMMIT  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:14.257233"], ["updated_at", "2019-04-04 09:48:14.257233"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.269167"], ["updated_at", "2019-04-04 09:48:14.269167"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.280028"], ["updated_at", "2019-04-04 09:48:14.280028"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:14.299499"], ["updated_at", "2019-04-04 09:48:14.299499"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.307840"], ["updated_at", "2019-04-04 09:48:14.307840"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (35.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.358931"], ["updated_at", "2019-04-04 09:48:14.358931"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (3.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:14.407474"], ["updated_at", "2019-04-04 09:48:14.407474"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 12ms (ActiveRecord: 7.8ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:14.429650"], ["updated_at", "2019-04-04 09:48:14.429650"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17ms (ActiveRecord: 10.6ms)  (1.1ms) ROLLBACK  (1.4ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:14.453478"], ["updated_at", "2019-04-04 09:48:14.453478"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 6.6ms)  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.2ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:48:14.484683"], ["updated_at", "2019-04-04 09:48:14.484683"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 8.6ms)  (1.6ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 6.5ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) ROLLBACK  (2.6ms) BEGIN  (1.4ms) ROLLBACK  (1.4ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:14.566951"], ["updated_at", "2019-04-04 09:48:14.566951"], ["synced_id", 123], ["host", "example.host"]]  (3.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:48:14.575807"], ["updated_at", "2019-04-04 09:48:14.575807"], ["synced_id", 123], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:48:14.588926"], ["updated_at", "2019-04-04 09:48:14.588926"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (2.8ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (2.7ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (3.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.650561"], ["updated_at", "2019-04-04 09:48:14.650561"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (2.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.682465"], ["updated_at", "2019-04-04 09:48:14.682465"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.703423"], ["updated_at", "2019-04-04 09:48:14.703423"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.733584"], ["updated_at", "2019-04-04 09:48:14.733584"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.765781"], ["updated_at", "2019-04-04 09:48:14.765781"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:48:14.790734"], ["updated_at", "2019-04-04 09:48:14.790734"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.261891"], ["updated_at", "2019-04-04 09:50:27.261891"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.271757"], ["updated_at", "2019-04-04 09:50:27.271757"], ["synced_id", 123], ["host", "test.host"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:50:27.300196"], ["updated_at", "2019-04-04 09:50:27.300196"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:27.323614"], ["updated_at", "2019-04-04 09:50:27.323614"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.0ms)  (1.5ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:27.339101"], ["updated_at", "2019-04-04 09:50:27.339101"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 5.9ms)  (1.6ms) ROLLBACK  (1.3ms) BEGIN  (1.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (3.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:27.364880"], ["updated_at", "2019-04-04 09:50:27.364880"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 8.1ms)  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (2.1ms) ROLLBACK  (1.7ms) BEGIN  (1.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:27.395547"], ["updated_at", "2019-04-04 09:50:27.395547"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 9.7ms)  (1.8ms) SELECT COUNT(*) FROM "accounts" Account Load (1.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 10ms (Views: 7.7ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.458859"], ["updated_at", "2019-04-04 09:50:27.458859"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (2.0ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (3.1ms) BEGIN  (1.8ms) ROLLBACK  (1.3ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.500778"], ["updated_at", "2019-04-04 09:50:27.500778"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.530178"], ["updated_at", "2019-04-04 09:50:27.530178"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (3.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.573395"], ["updated_at", "2019-04-04 09:50:27.573395"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (3.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.613605"], ["updated_at", "2019-04-04 09:50:27.613605"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.4ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.641464"], ["updated_at", "2019-04-04 09:50:27.641464"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.660452"], ["updated_at", "2019-04-04 09:50:27.660452"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (3.1ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.691418"], ["updated_at", "2019-04-04 09:50:27.691418"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.717499"], ["updated_at", "2019-04-04 09:50:27.717499"], ["synced_id", 123], ["host", "test.example"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.726813"], ["updated_at", "2019-04-04 09:50:27.726813"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.736214"], ["updated_at", "2019-04-04 09:50:27.736214"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:50:27.744603"], ["updated_at", "2019-04-04 09:50:27.744603"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.3ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.756825"], ["updated_at", "2019-04-04 09:50:27.756825"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.764719"], ["updated_at", "2019-04-04 09:50:27.764719"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:50:27.774848"], ["updated_at", "2019-04-04 09:50:27.774848"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457827"], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:50:27.785734"], ["updated_at", "2019-04-04 09:50:27.785734"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285027"], ["host", "example.test"]]  (3.0ms) COMMIT  (1.1ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 346], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:50:27.794670"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544227"], ["id", 346]]  (2.3ms) COMMIT MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) BEGIN MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 346]]  (1.3ms) COMMIT  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.810037"], ["updated_at", "2019-04-04 09:50:27.810037"], ["synced_id", 1], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.817621"], ["updated_at", "2019-04-04 09:50:27.817621"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.822049"], ["updated_at", "2019-04-04 09:50:27.822049"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:27.827171"], ["updated_at", "2019-04-04 09:50:27.827171"], ["synced_id", 2], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.837868"], ["updated_at", "2019-04-04 09:50:27.837868"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.841688"], ["updated_at", "2019-04-04 09:50:27.841688"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.853154"], ["updated_at", "2019-04-04 09:50:27.853154"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.858662"], ["updated_at", "2019-04-04 09:50:27.858662"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 353], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:50:27.866973"], ["id", 353]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.877614"], ["updated_at", "2019-04-04 09:50:27.877614"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.884051"], ["updated_at", "2019-04-04 09:50:27.884051"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 355], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:50:27.891978"], ["id", 355]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 355], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.902380"], ["updated_at", "2019-04-04 09:50:27.902380"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.907400"], ["updated_at", "2019-04-04 09:50:27.907400"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 357], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:50:27.913863"], ["id", 357]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 357], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.933148"], ["updated_at", "2019-04-04 09:50:27.933148"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.941527"], ["updated_at", "2019-04-04 09:50:27.941527"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:50:27.949730"], ["updated_at", "2019-04-04 09:50:27.949730"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:50:27.959472"], ["updated_at", "2019-04-04 09:50:27.959472"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.963810"], ["updated_at", "2019-04-04 09:50:27.963810"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:50:27.975966"], ["updated_at", "2019-04-04 09:50:27.975966"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.982355"], ["updated_at", "2019-04-04 09:50:27.982355"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:50:27.993995"], ["updated_at", "2019-04-04 09:50:27.993995"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:27.998932"], ["updated_at", "2019-04-04 09:50:27.998932"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.008013"], ["updated_at", "2019-04-04 09:50:28.008013"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:28.016343"], ["updated_at", "2019-04-04 09:50:28.016343"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:50:28.039987"], ["updated_at", "2019-04-04 09:50:28.039987"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 369], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:50:28.045248"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 369]]  (2.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 369], ["LIMIT", 1]]  (2.4ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (2.1ms) ROLLBACK  (2.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (2.4ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) ROLLBACK  (2.7ms) BEGIN  (2.1ms) ROLLBACK  (1.7ms) BEGIN  (2.1ms) ROLLBACK  (1.9ms) BEGIN  (3.8ms) ROLLBACK  (1.2ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Account Exists (3.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:50:28.151695"], ["updated_at", "2019-04-04 09:50:28.151695"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (2.1ms) ROLLBACK  (1.5ms) BEGIN  (3.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:50:28.173713"], ["updated_at", "2019-04-04 09:50:28.173713"], ["synced_id", 1]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SAVEPOINT active_record_1 Account Exists (3.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (4.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:50:28.186054"], ["updated_at", "2019-04-04 09:50:28.186054"], ["synced_id", 2]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:50:28.198710"], ["updated_at", "2019-04-04 09:50:28.198710"], ["synced_id", 3]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (3.0ms) ROLLBACK  (3.3ms) BEGIN Account Load (1.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:50:28.236166"], ["updated_at", "2019-04-04 09:50:28.236166"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 Account Update (2.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:50:28.243285"], ["synced_id", 0], ["id", 298]]  (2.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (3.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:50:28.262508"], ["updated_at", "2019-04-04 09:50:28.262508"], ["synced_id", 123]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (3.3ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:50:28.279960"], ["updated_at", "2019-04-04 09:50:28.279960"], ["synced_id", 123]]  (2.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:50:28.290853"], ["updated_at", "2019-04-04 09:50:28.290853"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.301908"], ["updated_at", "2019-04-04 09:50:28.301908"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:28.311234"], ["updated_at", "2019-04-04 09:50:28.311234"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT COUNT(*) FROM "accounts"  (1.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.323449"], ["updated_at", "2019-04-04 09:50:28.323449"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:28.329420"], ["updated_at", "2019-04-04 09:50:28.329420"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.339867"], ["updated_at", "2019-04-04 09:50:28.339867"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (3.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:28.348765"], ["updated_at", "2019-04-04 09:50:28.348765"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.364262"], ["updated_at", "2019-04-04 09:50:28.364262"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:50:28.375805"], ["updated_at", "2019-04-04 09:50:28.375805"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (3.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.391163"], ["updated_at", "2019-04-04 09:50:28.391163"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.398546"], ["updated_at", "2019-04-04 09:50:28.398546"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 310], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:50:28.409677"], ["id", 310]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 310], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.419360"], ["updated_at", "2019-04-04 09:50:28.419360"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.422770"], ["updated_at", "2019-04-04 09:50:28.422770"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 312], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:50:28.427764"], ["id", 312]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 312], ["LIMIT", 1]]  (2.8ms) ROLLBACK  (1.4ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.442303"], ["updated_at", "2019-04-04 09:50:28.442303"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.448403"], ["updated_at", "2019-04-04 09:50:28.448403"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 314], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:50:28.457521"], ["id", 314]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.465355"], ["updated_at", "2019-04-04 09:50:28.465355"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:50:28.469289"], ["updated_at", "2019-04-04 09:50:28.469289"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 316], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:50:28.474262"], ["id", 316]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (2.6ms) ROLLBACK  (1.4ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:50:28.490699"], ["updated_at", "2019-04-04 09:50:28.490699"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457828"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.6ms) BEGIN Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:50:28.503118"], ["updated_at", "2019-04-04 09:50:28.503118"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285028"]]  (8.9ms) COMMIT  (2.2ms) BEGIN Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 318], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:50:28.526355"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544228"], ["id", 318]]  (2.8ms) COMMIT Account Load (1.6ms) SELECT "accounts".* FROM "accounts"  (1.5ms) BEGIN Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 318]]  (1.5ms) COMMIT  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:50:28.544092"], ["updated_at", "2019-04-04 09:50:28.544092"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (3.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 319], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:50:28.557589"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 319]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 319], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (2.9ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.369382"], ["updated_at", "2019-04-04 09:52:24.369382"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) ROLLBACK  (1.5ms) BEGIN  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.425691"], ["updated_at", "2019-04-04 09:52:24.425691"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (3.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.469185"], ["updated_at", "2019-04-04 09:52:24.469185"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.492471"], ["updated_at", "2019-04-04 09:52:24.492471"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.522165"], ["updated_at", "2019-04-04 09:52:24.522165"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.549084"], ["updated_at", "2019-04-04 09:52:24.549084"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.574710"], ["updated_at", "2019-04-04 09:52:24.574710"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:24.611125"], ["updated_at", "2019-04-04 09:52:24.611125"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.638782"], ["updated_at", "2019-04-04 09:52:24.638782"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.645150"], ["updated_at", "2019-04-04 09:52:24.645150"], ["synced_id", 123], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (2.0ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:52:24.737813"], ["updated_at", "2019-04-04 09:52:24.737813"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285144"], ["host", "example.test"]]  (7.6ms) COMMIT  (1.8ms) BEGIN MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 373], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:24.755307"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544344"], ["id", 373]]  (3.7ms) COMMIT MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.1ms) BEGIN MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 373]]  (3.7ms) COMMIT  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:52:24.777779"], ["updated_at", "2019-04-04 09:52:24.777779"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457944"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (2.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.792404"], ["updated_at", "2019-04-04 09:52:24.792404"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.799574"], ["updated_at", "2019-04-04 09:52:24.799574"], ["synced_id", 2], ["host", "example.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.808904"], ["updated_at", "2019-04-04 09:52:24.808904"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.815759"], ["updated_at", "2019-04-04 09:52:24.815759"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.826462"], ["updated_at", "2019-04-04 09:52:24.826462"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:24.849532"], ["updated_at", "2019-04-04 09:52:24.849532"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.863633"], ["updated_at", "2019-04-04 09:52:24.863633"], ["synced_id", 123], ["host", "test.example"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.876893"], ["updated_at", "2019-04-04 09:52:24.876893"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.886186"], ["updated_at", "2019-04-04 09:52:24.886186"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:24.896274"], ["updated_at", "2019-04-04 09:52:24.896274"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 382], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:24.901597"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 382]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 382], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.922825"], ["updated_at", "2019-04-04 09:52:24.922825"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.934507"], ["updated_at", "2019-04-04 09:52:24.934507"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:24.946965"], ["updated_at", "2019-04-04 09:52:24.946965"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.958540"], ["updated_at", "2019-04-04 09:52:24.958540"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.988780"], ["updated_at", "2019-04-04 09:52:24.988780"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:24.996526"], ["updated_at", "2019-04-04 09:52:24.996526"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:25.006802"], ["updated_at", "2019-04-04 09:52:25.006802"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:25.019657"], ["updated_at", "2019-04-04 09:52:25.019657"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.027179"], ["updated_at", "2019-04-04 09:52:25.027179"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:25.038382"], ["updated_at", "2019-04-04 09:52:25.038382"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.043451"], ["updated_at", "2019-04-04 09:52:25.043451"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:25.051251"], ["updated_at", "2019-04-04 09:52:25.051251"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.059072"], ["updated_at", "2019-04-04 09:52:25.059072"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.070187"], ["updated_at", "2019-04-04 09:52:25.070187"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.078153"], ["updated_at", "2019-04-04 09:52:25.078153"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 394], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:25.086330"], ["id", 394]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.094774"], ["updated_at", "2019-04-04 09:52:25.094774"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.099274"], ["updated_at", "2019-04-04 09:52:25.099274"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 396], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:25.109029"], ["id", 396]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 396], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.120158"], ["updated_at", "2019-04-04 09:52:25.120158"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.124657"], ["updated_at", "2019-04-04 09:52:25.124657"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 398], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:25.130210"], ["id", 398]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 398], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.142256"], ["updated_at", "2019-04-04 09:52:25.142256"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.148348"], ["updated_at", "2019-04-04 09:52:25.148348"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:25.162205"], ["updated_at", "2019-04-04 09:52:25.162205"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (2.0ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:25.175324"], ["updated_at", "2019-04-04 09:52:25.175324"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 322], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:25.181903"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 322]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 322], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:25.199063"], ["updated_at", "2019-04-04 09:52:25.199063"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.211789"], ["updated_at", "2019-04-04 09:52:25.211789"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.217404"], ["updated_at", "2019-04-04 09:52:25.217404"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (2.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 325], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:25.227810"], ["id", 325]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (2.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.239473"], ["updated_at", "2019-04-04 09:52:25.239473"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.245751"], ["updated_at", "2019-04-04 09:52:25.245751"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 327], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:25.255402"], ["id", 327]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.267024"], ["updated_at", "2019-04-04 09:52:25.267024"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.275313"], ["updated_at", "2019-04-04 09:52:25.275313"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 329], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:25.283573"], ["id", 329]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 329], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.293645"], ["updated_at", "2019-04-04 09:52:25.293645"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.297791"], ["updated_at", "2019-04-04 09:52:25.297791"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 331], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:25.306443"], ["id", 331]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 331], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.318336"], ["updated_at", "2019-04-04 09:52:25.318336"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:25.330242"], ["updated_at", "2019-04-04 09:52:25.330242"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.339586"], ["updated_at", "2019-04-04 09:52:25.339586"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:25.344938"], ["updated_at", "2019-04-04 09:52:25.344938"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.352968"], ["updated_at", "2019-04-04 09:52:25.352968"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:25.361657"], ["updated_at", "2019-04-04 09:52:25.361657"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:25.370013"], ["updated_at", "2019-04-04 09:52:25.370013"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:25.374998"], ["updated_at", "2019-04-04 09:52:25.374998"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:52:25.385985"], ["updated_at", "2019-04-04 09:52:25.385985"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:52:25.391337"], ["synced_id", 0], ["id", 340]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:25.404689"], ["updated_at", "2019-04-04 09:52:25.404689"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:25.411725"], ["updated_at", "2019-04-04 09:52:25.411725"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (3.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:25.428342"], ["updated_at", "2019-04-04 09:52:25.428342"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457945"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.0ms) BEGIN Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:25.439869"], ["updated_at", "2019-04-04 09:52:25.439869"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285145"]]  (1.9ms) COMMIT  (0.9ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 343], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:25.448311"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544345"], ["id", 343]]  (2.1ms) COMMIT Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN Account Destroy (2.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 343]]  (2.5ms) COMMIT  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:25.468141"], ["updated_at", "2019-04-04 09:52:25.468141"], ["synced_id", 1]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:25.474443"], ["updated_at", "2019-04-04 09:52:25.474443"], ["synced_id", 2]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:25.482801"], ["updated_at", "2019-04-04 09:52:25.482801"], ["synced_id", 3]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:43.744140"], ["updated_at", "2019-04-04 09:52:43.744140"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 46ms (ActiveRecord: 17.3ms)  (1.7ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:43.764884"], ["updated_at", "2019-04-04 09:52:43.764884"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 7.6ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.6ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:43.788192"], ["updated_at", "2019-04-04 09:52:43.788192"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 7.7ms)  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:43.833253"], ["updated_at", "2019-04-04 09:52:43.833253"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 28ms (ActiveRecord: 14.0ms)  (1.9ms) SELECT COUNT(*) FROM "accounts"  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (3.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:43.901523"], ["updated_at", "2019-04-04 09:52:43.901523"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:43.909101"], ["updated_at", "2019-04-04 09:52:43.909101"], ["synced_id", 123], ["host", "test.host"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (2.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:43.932369"], ["updated_at", "2019-04-04 09:52:43.932369"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) ROLLBACK  (2.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:43.964101"], ["updated_at", "2019-04-04 09:52:43.964101"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (2.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:43.986078"], ["updated_at", "2019-04-04 09:52:43.986078"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.017195"], ["updated_at", "2019-04-04 09:52:44.017195"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (3.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.057065"], ["updated_at", "2019-04-04 09:52:44.057065"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.086182"], ["updated_at", "2019-04-04 09:52:44.086182"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.117432"], ["updated_at", "2019-04-04 09:52:44.117432"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.135546"], ["updated_at", "2019-04-04 09:52:44.135546"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.4ms) BEGIN  (2.0ms) ROLLBACK  (0.8ms) BEGIN  (1.5ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:44.185464"], ["updated_at", "2019-04-04 09:52:44.185464"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.5ms) BEGIN  (1.8ms) ROLLBACK  (1.3ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.213885"], ["updated_at", "2019-04-04 09:52:44.213885"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.242002"], ["updated_at", "2019-04-04 09:52:44.242002"], ["synced_id", 123], ["host", "test.example"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (2.6ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.254308"], ["updated_at", "2019-04-04 09:52:44.254308"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.264574"], ["updated_at", "2019-04-04 09:52:44.264574"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:52:44.275761"], ["updated_at", "2019-04-04 09:52:44.275761"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457964"], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:52:44.287651"], ["updated_at", "2019-04-04 09:52:44.287651"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285164"], ["host", "example.test"]]  (7.7ms) COMMIT  (1.0ms) BEGIN MultiApplicationsAccount Exists (3.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 410], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:44.304107"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544364"], ["id", 410]]  (2.0ms) COMMIT MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.1ms) BEGIN MultiApplicationsAccount Destroy (1.4ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 410]]  (1.8ms) COMMIT  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.322124"], ["updated_at", "2019-04-04 09:52:44.322124"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.332791"], ["updated_at", "2019-04-04 09:52:44.332791"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.343082"], ["updated_at", "2019-04-04 09:52:44.343082"], ["synced_id", 123], ["host", "test.example"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.358826"], ["updated_at", "2019-04-04 09:52:44.358826"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:44.372924"], ["updated_at", "2019-04-04 09:52:44.372924"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 413], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:44.379625"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 413]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 413], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.394120"], ["updated_at", "2019-04-04 09:52:44.394120"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.402072"], ["updated_at", "2019-04-04 09:52:44.402072"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (3.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:44.416806"], ["updated_at", "2019-04-04 09:52:44.416806"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.8ms) ROLLBACK  (1.6ms) BEGIN MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:44.439675"], ["updated_at", "2019-04-04 09:52:44.439675"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.452543"], ["updated_at", "2019-04-04 09:52:44.452543"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (2.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:44.466886"], ["updated_at", "2019-04-04 09:52:44.466886"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (3.6ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.477423"], ["updated_at", "2019-04-04 09:52:44.477423"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:52:44.489615"], ["updated_at", "2019-04-04 09:52:44.489615"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.494132"], ["updated_at", "2019-04-04 09:52:44.494132"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.504282"], ["updated_at", "2019-04-04 09:52:44.504282"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.508815"], ["updated_at", "2019-04-04 09:52:44.508815"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 423], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (3.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:44.518771"], ["id", 423]]  (2.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.534736"], ["updated_at", "2019-04-04 09:52:44.534736"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.540978"], ["updated_at", "2019-04-04 09:52:44.540978"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 425], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:44.551384"], ["id", 425]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 425], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.565364"], ["updated_at", "2019-04-04 09:52:44.565364"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.575670"], ["updated_at", "2019-04-04 09:52:44.575670"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 427], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:44.584349"], ["id", 427]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 427], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.596719"], ["updated_at", "2019-04-04 09:52:44.596719"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.605333"], ["updated_at", "2019-04-04 09:52:44.605333"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.619972"], ["updated_at", "2019-04-04 09:52:44.619972"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.625247"], ["updated_at", "2019-04-04 09:52:44.625247"], ["synced_id", 2], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.633675"], ["updated_at", "2019-04-04 09:52:44.633675"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.639105"], ["updated_at", "2019-04-04 09:52:44.639105"], ["synced_id", 2], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:44.653703"], ["updated_at", "2019-04-04 09:52:44.653703"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:44.658205"], ["updated_at", "2019-04-04 09:52:44.658205"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:44.665209"], ["updated_at", "2019-04-04 09:52:44.665209"], ["synced_id", 3]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.676474"], ["updated_at", "2019-04-04 09:52:44.676474"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.685441"], ["updated_at", "2019-04-04 09:52:44.685441"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 355], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:44.698165"], ["id", 355]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.708020"], ["updated_at", "2019-04-04 09:52:44.708020"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.716087"], ["updated_at", "2019-04-04 09:52:44.716087"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 357], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:44.724613"], ["id", 357]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.736150"], ["updated_at", "2019-04-04 09:52:44.736150"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.741300"], ["updated_at", "2019-04-04 09:52:44.741300"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 359], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:44.750571"], ["id", 359]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 359], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.762901"], ["updated_at", "2019-04-04 09:52:44.762901"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.769362"], ["updated_at", "2019-04-04 09:52:44.769362"], ["provider", "bookingsync"], ["synced_id", 123]]  (2.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 361], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:52:44.780910"], ["id", 361]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 361], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.794581"], ["updated_at", "2019-04-04 09:52:44.794581"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:44.804901"], ["updated_at", "2019-04-04 09:52:44.804901"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.816156"], ["updated_at", "2019-04-04 09:52:44.816156"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:44.822702"], ["updated_at", "2019-04-04 09:52:44.822702"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.4ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.833044"], ["updated_at", "2019-04-04 09:52:44.833044"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:44.839459"], ["updated_at", "2019-04-04 09:52:44.839459"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:52:44.851293"], ["updated_at", "2019-04-04 09:52:44.851293"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.4ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:52:44.863873"], ["updated_at", "2019-04-04 09:52:44.863873"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.5ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:44.876567"], ["updated_at", "2019-04-04 09:52:44.876567"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:44.891157"], ["updated_at", "2019-04-04 09:52:44.891157"], ["synced_id", 123]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN Account Load (2.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:52:44.911371"], ["updated_at", "2019-04-04 09:52:44.911371"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:52:44.917808"], ["synced_id", 0], ["id", 372]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (2.9ms) ROLLBACK  (1.4ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:52:44.937987"], ["updated_at", "2019-04-04 09:52:44.937987"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 373], ["LIMIT", 1]] Account Update (2.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:44.947117"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 373]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 373], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.5ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:52:44.963713"], ["updated_at", "2019-04-04 09:52:44.963713"], ["synced_id", 123]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.8ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:44.981194"], ["updated_at", "2019-04-04 09:52:44.981194"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (1.0ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:44.998458"], ["updated_at", "2019-04-04 09:52:44.998458"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554457964"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (3.0ms) ROLLBACK  (1.2ms) BEGIN Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:52:45.014310"], ["updated_at", "2019-04-04 09:52:45.014310"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285165"]]  (4.0ms) COMMIT  (1.3ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 376], ["LIMIT", 1]] Account Update (2.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:52:45.027079"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544365"], ["id", 376]]  (3.0ms) COMMIT Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (1.1ms) BEGIN Account Destroy (2.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 376]]  (3.5ms) COMMIT  (0.8ms) BEGIN  (2.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:53:54.866204"], ["updated_at", "2019-04-04 09:53:54.866204"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 54ms (ActiveRecord: 22.1ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:53:54.883349"], ["updated_at", "2019-04-04 09:53:54.883349"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.4ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (2.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:53:54.915726"], ["updated_at", "2019-04-04 09:53:54.915726"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 7.8ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:53:54.938794"], ["updated_at", "2019-04-04 09:53:54.938794"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.0ms)  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:53:54.968889"], ["updated_at", "2019-04-04 09:53:54.968889"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 437], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:53:54.976241"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 437]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 437], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:54.991372"], ["updated_at", "2019-04-04 09:53:54.991372"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:53:55.017882"], ["updated_at", "2019-04-04 09:53:55.017882"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285235"], ["host", "example.test"]]  (8.1ms) COMMIT  (1.3ms) BEGIN MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 439], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:53:55.034160"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544435"], ["id", 439]]  (2.6ms) COMMIT MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.0ms) BEGIN MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 439]]  (1.9ms) COMMIT  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:53:55.053485"], ["updated_at", "2019-04-04 09:53:55.053485"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554458035"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.5ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.066604"], ["updated_at", "2019-04-04 09:53:55.066604"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.071821"], ["updated_at", "2019-04-04 09:53:55.071821"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.077794"], ["updated_at", "2019-04-04 09:53:55.077794"], ["synced_id", 1], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.083933"], ["updated_at", "2019-04-04 09:53:55.083933"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.099334"], ["updated_at", "2019-04-04 09:53:55.099334"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.118522"], ["updated_at", "2019-04-04 09:53:55.118522"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.130018"], ["updated_at", "2019-04-04 09:53:55.130018"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.138263"], ["updated_at", "2019-04-04 09:53:55.138263"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.150900"], ["updated_at", "2019-04-04 09:53:55.150900"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.155531"], ["updated_at", "2019-04-04 09:53:55.155531"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:53:55.164958"], ["updated_at", "2019-04-04 09:53:55.164958"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (1.3ms) BEGIN MultiApplicationsAccount Load (1.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:53:55.183019"], ["updated_at", "2019-04-04 09:53:55.183019"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.189425"], ["updated_at", "2019-04-04 09:53:55.189425"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:53:55.204757"], ["updated_at", "2019-04-04 09:53:55.204757"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.214046"], ["updated_at", "2019-04-04 09:53:55.214046"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:53:55.224041"], ["updated_at", "2019-04-04 09:53:55.224041"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.230246"], ["updated_at", "2019-04-04 09:53:55.230246"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (3.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.243013"], ["updated_at", "2019-04-04 09:53:55.243013"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.249961"], ["updated_at", "2019-04-04 09:53:55.249961"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 456], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:53:55.260624"], ["id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.271337"], ["updated_at", "2019-04-04 09:53:55.271337"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.277023"], ["updated_at", "2019-04-04 09:53:55.277023"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 458], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:53:55.285765"], ["id", 458]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 458], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.295440"], ["updated_at", "2019-04-04 09:53:55.295440"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.301265"], ["updated_at", "2019-04-04 09:53:55.301265"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 460], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:53:55.307735"], ["id", 460]]  (2.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 460], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.319706"], ["updated_at", "2019-04-04 09:53:55.319706"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.323835"], ["updated_at", "2019-04-04 09:53:55.323835"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (3.6ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.348543"], ["updated_at", "2019-04-04 09:53:55.348543"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.361446"], ["updated_at", "2019-04-04 09:53:55.361446"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.371961"], ["updated_at", "2019-04-04 09:53:55.371961"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (2.5ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:53:55.388780"], ["updated_at", "2019-04-04 09:53:55.388780"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.405510"], ["updated_at", "2019-04-04 09:53:55.405510"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.2ms) BEGIN Account Load (1.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (3.1ms) SAVEPOINT active_record_1 Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:53:55.428022"], ["updated_at", "2019-04-04 09:53:55.428022"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Update (1.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:53:55.433680"], ["synced_id", 0], ["id", 380]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (3.0ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:53:55.452320"], ["updated_at", "2019-04-04 09:53:55.452320"], ["synced_id", 1]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (3.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:53:55.459947"], ["updated_at", "2019-04-04 09:53:55.459947"], ["synced_id", 2]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:53:55.469971"], ["updated_at", "2019-04-04 09:53:55.469971"], ["synced_id", 3]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:53:55.490882"], ["updated_at", "2019-04-04 09:53:55.490882"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554458035"]]  (4.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:53:55.504627"], ["updated_at", "2019-04-04 09:53:55.504627"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285235"]]  (2.4ms) COMMIT  (1.2ms) BEGIN Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 385], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:53:55.513474"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544435"], ["id", 385]]  (2.0ms) COMMIT Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (1.7ms) BEGIN Account Destroy (1.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 385]]  (1.9ms) COMMIT  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:53:55.533723"], ["updated_at", "2019-04-04 09:53:55.533723"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:53:55.547625"], ["updated_at", "2019-04-04 09:53:55.547625"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.557845"], ["updated_at", "2019-04-04 09:53:55.557845"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 387], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:53:55.565276"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 387]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 387], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:53:55.581520"], ["updated_at", "2019-04-04 09:53:55.581520"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:53:55.590511"], ["updated_at", "2019-04-04 09:53:55.590511"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.606909"], ["updated_at", "2019-04-04 09:53:55.606909"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SELECT COUNT(*) FROM "accounts" Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:53:55.618937"], ["updated_at", "2019-04-04 09:53:55.618937"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts"  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.633980"], ["updated_at", "2019-04-04 09:53:55.633980"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:53:55.640954"], ["updated_at", "2019-04-04 09:53:55.640954"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (2.1ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.653131"], ["updated_at", "2019-04-04 09:53:55.653131"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:53:55.661397"], ["updated_at", "2019-04-04 09:53:55.661397"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.674558"], ["updated_at", "2019-04-04 09:53:55.674558"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:53:55.683720"], ["updated_at", "2019-04-04 09:53:55.683720"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (3.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.697555"], ["updated_at", "2019-04-04 09:53:55.697555"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.704025"], ["updated_at", "2019-04-04 09:53:55.704025"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 399], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:53:55.712907"], ["id", 399]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.722192"], ["updated_at", "2019-04-04 09:53:55.722192"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.727840"], ["updated_at", "2019-04-04 09:53:55.727840"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 401], ["LIMIT", 1]] Account Update (2.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:53:55.735688"], ["id", 401]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.748612"], ["updated_at", "2019-04-04 09:53:55.748612"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.754688"], ["updated_at", "2019-04-04 09:53:55.754688"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 403], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:53:55.764144"], ["id", 403]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 403], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.775746"], ["updated_at", "2019-04-04 09:53:55.775746"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:55.781896"], ["updated_at", "2019-04-04 09:53:55.781896"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 405], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:53:55.792105"], ["id", 405]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 405], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.808140"], ["updated_at", "2019-04-04 09:53:55.808140"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.838342"], ["updated_at", "2019-04-04 09:53:55.838342"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.858489"], ["updated_at", "2019-04-04 09:53:55.858489"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.891854"], ["updated_at", "2019-04-04 09:53:55.891854"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.915531"], ["updated_at", "2019-04-04 09:53:55.915531"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:53:55.946134"], ["updated_at", "2019-04-04 09:53:55.946134"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) ROLLBACK  (1.6ms) BEGIN  (1.8ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:53:56.000862"], ["updated_at", "2019-04-04 09:53:56.000862"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (3.5ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:56.017740"], ["updated_at", "2019-04-04 09:53:56.017740"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:53:56.027758"], ["updated_at", "2019-04-04 09:53:56.027758"], ["synced_id", 123], ["host", "test.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (2.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.747495"], ["updated_at", "2019-04-04 09:55:14.747495"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:55:14.762373"], ["updated_at", "2019-04-04 09:55:14.762373"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.772061"], ["updated_at", "2019-04-04 09:55:14.772061"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:55:14.777570"], ["updated_at", "2019-04-04 09:55:14.777570"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.787468"], ["updated_at", "2019-04-04 09:55:14.787468"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:55:14.796981"], ["updated_at", "2019-04-04 09:55:14.796981"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.4ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.809988"], ["updated_at", "2019-04-04 09:55:14.809988"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:55:14.818581"], ["updated_at", "2019-04-04 09:55:14.818581"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.831112"], ["updated_at", "2019-04-04 09:55:14.831112"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.838135"], ["updated_at", "2019-04-04 09:55:14.838135"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 416], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:55:14.847765"], ["id", 416]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.866503"], ["updated_at", "2019-04-04 09:55:14.866503"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.876392"], ["updated_at", "2019-04-04 09:55:14.876392"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 418], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:55:14.885883"], ["id", 418]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 418], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.900868"], ["updated_at", "2019-04-04 09:55:14.900868"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.910252"], ["updated_at", "2019-04-04 09:55:14.910252"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 420], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:55:14.918819"], ["id", 420]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 420], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.929724"], ["updated_at", "2019-04-04 09:55:14.929724"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:14.934926"], ["updated_at", "2019-04-04 09:55:14.934926"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 422], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:55:14.945242"], ["id", 422]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-04 09:55:14.959969"], ["updated_at", "2019-04-04 09:55:14.959969"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-04 09:55:14.963800"], ["synced_id", 0], ["id", 423]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:55:14.983105"], ["updated_at", "2019-04-04 09:55:14.983105"], ["synced_id", 1]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:55:14.991719"], ["updated_at", "2019-04-04 09:55:14.991719"], ["synced_id", 2]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:55:14.998504"], ["updated_at", "2019-04-04 09:55:14.998504"], ["synced_id", 3]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:55:15.030877"], ["updated_at", "2019-04-04 09:55:15.030877"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.5ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:55:15.043425"], ["updated_at", "2019-04-04 09:55:15.043425"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:55:15.071893"], ["updated_at", "2019-04-04 09:55:15.071893"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (1.0ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:55:15.084180"], ["updated_at", "2019-04-04 09:55:15.084180"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285315"]]  (7.7ms) COMMIT  (1.3ms) BEGIN Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 429], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:55:15.098784"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544515"], ["id", 429]]  (2.1ms) COMMIT Account Load (2.7ms) SELECT "accounts".* FROM "accounts"  (1.2ms) BEGIN Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 429]]  (2.0ms) COMMIT  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:55:15.119389"], ["updated_at", "2019-04-04 09:55:15.119389"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554458115"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.132659"], ["updated_at", "2019-04-04 09:55:15.132659"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 431], ["LIMIT", 1]] Account Update (2.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-04 09:55:15.141308"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 431]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 431], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:55:15.156132"], ["updated_at", "2019-04-04 09:55:15.156132"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.227333"], ["updated_at", "2019-04-04 09:55:15.227333"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:55:15.288537"], ["updated_at", "2019-04-04 09:55:15.288537"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 7.1ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:55:15.309211"], ["updated_at", "2019-04-04 09:55:15.309211"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 13ms (ActiveRecord: 8.9ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-04 09:55:15.326417"], ["updated_at", "2019-04-04 09:55:15.326417"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.8ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:55:15.350821"], ["updated_at", "2019-04-04 09:55:15.350821"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (3.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 8.2ms)  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.374620"], ["updated_at", "2019-04-04 09:55:15.374620"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (4.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.413931"], ["updated_at", "2019-04-04 09:55:15.413931"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.444782"], ["updated_at", "2019-04-04 09:55:15.444782"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.466974"], ["updated_at", "2019-04-04 09:55:15.466974"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.490209"], ["updated_at", "2019-04-04 09:55:15.490209"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.509329"], ["updated_at", "2019-04-04 09:55:15.509329"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:55:15.540402"], ["updated_at", "2019-04-04 09:55:15.540402"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554458115"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-04 09:55:15.548001"], ["updated_at", "2019-04-04 09:55:15.548001"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554285315"], ["host", "example.test"]]  (7.8ms) COMMIT  (1.1ms) BEGIN MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 472], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:55:15.562254"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554544515"], ["id", 472]]  (2.1ms) COMMIT MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) BEGIN MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 472]]  (1.5ms) COMMIT  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.581241"], ["updated_at", "2019-04-04 09:55:15.581241"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.592159"], ["updated_at", "2019-04-04 09:55:15.592159"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.604886"], ["updated_at", "2019-04-04 09:55:15.604886"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.612317"], ["updated_at", "2019-04-04 09:55:15.612317"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:55:15.626858"], ["updated_at", "2019-04-04 09:55:15.626858"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.637960"], ["updated_at", "2019-04-04 09:55:15.637960"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.649556"], ["updated_at", "2019-04-04 09:55:15.649556"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.663417"], ["updated_at", "2019-04-04 09:55:15.663417"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.678345"], ["updated_at", "2019-04-04 09:55:15.678345"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.684695"], ["updated_at", "2019-04-04 09:55:15.684695"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.699982"], ["updated_at", "2019-04-04 09:55:15.699982"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.709260"], ["updated_at", "2019-04-04 09:55:15.709260"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 479], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:55:15.722870"], ["id", 479]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.732641"], ["updated_at", "2019-04-04 09:55:15.732641"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.741268"], ["updated_at", "2019-04-04 09:55:15.741268"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 481], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:55:15.750039"], ["id", 481]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 481], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.761894"], ["updated_at", "2019-04-04 09:55:15.761894"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.767016"], ["updated_at", "2019-04-04 09:55:15.767016"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 483], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-04 09:55:15.776722"], ["id", 483]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 483], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.788724"], ["updated_at", "2019-04-04 09:55:15.788724"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.793311"], ["updated_at", "2019-04-04 09:55:15.793311"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:55:15.800071"], ["updated_at", "2019-04-04 09:55:15.800071"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (3.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.1ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:55:15.815991"], ["updated_at", "2019-04-04 09:55:15.815991"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.823869"], ["updated_at", "2019-04-04 09:55:15.823869"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:55:15.839197"], ["updated_at", "2019-04-04 09:55:15.839197"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.847487"], ["updated_at", "2019-04-04 09:55:15.847487"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.2ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-04 09:55:15.860310"], ["updated_at", "2019-04-04 09:55:15.860310"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.865935"], ["updated_at", "2019-04-04 09:55:15.865935"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-04 09:55:15.879206"], ["updated_at", "2019-04-04 09:55:15.879206"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 494], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-04 09:55:15.888648"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 494]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 494], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.5ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-04 09:55:15.907223"], ["updated_at", "2019-04-04 09:55:15.907223"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.933308"], ["updated_at", "2019-04-04 09:55:15.933308"], ["synced_id", 1], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.942153"], ["updated_at", "2019-04-04 09:55:15.942153"], ["synced_id", 2], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.949663"], ["updated_at", "2019-04-04 09:55:15.949663"], ["synced_id", 1], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.956489"], ["updated_at", "2019-04-04 09:55:15.956489"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (2.4ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-04 09:55:15.976260"], ["updated_at", "2019-04-04 09:55:15.976260"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:15.993298"], ["updated_at", "2019-04-04 09:55:15.993298"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-04 09:55:16.000816"], ["updated_at", "2019-04-04 09:55:16.000816"], ["synced_id", 123], ["host", "test.host"]]  (2.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (3.3ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) ROLLBACK  (1.3ms) BEGIN  (1.5ms) ROLLBACK  (2.4ms) BEGIN  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) ROLLBACK  (1.4ms) BEGIN  (3.3ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (3.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:10.376414"], ["updated_at", "2019-04-08 08:24:10.376414"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.5ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:10.411427"], ["updated_at", "2019-04-08 08:24:10.411427"], ["synced_id", 1]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:10.418478"], ["updated_at", "2019-04-08 08:24:10.418478"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:10.423125"], ["updated_at", "2019-04-08 08:24:10.423125"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:24:10.438449"], ["updated_at", "2019-04-08 08:24:10.438449"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:24:10.442100"], ["synced_id", 0], ["id", 441]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:10.459192"], ["updated_at", "2019-04-08 08:24:10.459192"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (7.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:10.488380"], ["updated_at", "2019-04-08 08:24:10.488380"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:10.500699"], ["updated_at", "2019-04-08 08:24:10.500699"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:10.510532"], ["updated_at", "2019-04-08 08:24:10.510532"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798250"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:10.518183"], ["updated_at", "2019-04-08 08:24:10.518183"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554625450"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 445], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:10.522524"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554884650"], ["id", 445]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.4ms) SAVEPOINT active_record_1 Account Destroy (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 445]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.533339"], ["updated_at", "2019-04-08 08:24:10.533339"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 446], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:10.537051"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 446]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 446], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.547145"], ["updated_at", "2019-04-08 08:24:10.547145"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (3.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:10.561860"], ["updated_at", "2019-04-08 08:24:10.561860"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.571031"], ["updated_at", "2019-04-08 08:24:10.571031"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:10.576486"], ["updated_at", "2019-04-08 08:24:10.576486"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.586128"], ["updated_at", "2019-04-08 08:24:10.586128"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:10.593212"], ["updated_at", "2019-04-08 08:24:10.593212"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.603275"], ["updated_at", "2019-04-08 08:24:10.603275"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:10.610286"], ["updated_at", "2019-04-08 08:24:10.610286"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.619979"], ["updated_at", "2019-04-08 08:24:10.619979"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.624647"], ["updated_at", "2019-04-08 08:24:10.624647"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 456], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:10.631476"], ["id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 456], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.642854"], ["updated_at", "2019-04-08 08:24:10.642854"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.647558"], ["updated_at", "2019-04-08 08:24:10.647558"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 458], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:10.654147"], ["id", 458]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 458], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.664101"], ["updated_at", "2019-04-08 08:24:10.664101"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.668108"], ["updated_at", "2019-04-08 08:24:10.668108"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 460], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:10.672815"], ["id", 460]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.679624"], ["updated_at", "2019-04-08 08:24:10.679624"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.684131"], ["updated_at", "2019-04-08 08:24:10.684131"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 462], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:10.690023"], ["id", 462]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:10.730580"], ["updated_at", "2019-04-08 08:24:10.730580"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.741738"], ["updated_at", "2019-04-08 08:24:10.741738"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:10.747590"], ["updated_at", "2019-04-08 08:24:10.747590"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (5.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.769623"], ["updated_at", "2019-04-08 08:24:10.769623"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (4.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:10.823429"], ["updated_at", "2019-04-08 08:24:10.823429"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.3ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:10.834307"], ["updated_at", "2019-04-08 08:24:10.834307"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:10.848406"], ["updated_at", "2019-04-08 08:24:10.848406"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.4ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:10.861941"], ["updated_at", "2019-04-08 08:24:10.861941"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.878645"], ["updated_at", "2019-04-08 08:24:10.878645"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.902190"], ["updated_at", "2019-04-08 08:24:10.902190"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.916800"], ["updated_at", "2019-04-08 08:24:10.916800"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.932359"], ["updated_at", "2019-04-08 08:24:10.932359"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.954088"], ["updated_at", "2019-04-08 08:24:10.954088"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:10.974189"], ["updated_at", "2019-04-08 08:24:10.974189"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.022078"], ["updated_at", "2019-04-08 08:24:11.022078"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.026125"], ["updated_at", "2019-04-08 08:24:11.026125"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.035218"], ["updated_at", "2019-04-08 08:24:11.035218"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.039400"], ["updated_at", "2019-04-08 08:24:11.039400"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:11.047264"], ["updated_at", "2019-04-08 08:24:11.047264"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:11.056705"], ["updated_at", "2019-04-08 08:24:11.056705"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.060651"], ["updated_at", "2019-04-08 08:24:11.060651"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:11.070301"], ["updated_at", "2019-04-08 08:24:11.070301"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.074505"], ["updated_at", "2019-04-08 08:24:11.074505"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:11.084038"], ["updated_at", "2019-04-08 08:24:11.084038"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.090452"], ["updated_at", "2019-04-08 08:24:11.090452"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.099786"], ["updated_at", "2019-04-08 08:24:11.099786"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.104240"], ["updated_at", "2019-04-08 08:24:11.104240"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 517], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:11.110255"], ["id", 517]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.119083"], ["updated_at", "2019-04-08 08:24:11.119083"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.123577"], ["updated_at", "2019-04-08 08:24:11.123577"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 519], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:11.130309"], ["id", 519]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 519], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.139797"], ["updated_at", "2019-04-08 08:24:11.139797"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.143984"], ["updated_at", "2019-04-08 08:24:11.143984"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 521], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:11.151119"], ["id", 521]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 521], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:11.160088"], ["updated_at", "2019-04-08 08:24:11.160088"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:11.164900"], ["updated_at", "2019-04-08 08:24:11.164900"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:11.169300"], ["updated_at", "2019-04-08 08:24:11.169300"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:11.173421"], ["updated_at", "2019-04-08 08:24:11.173421"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:11.182752"], ["updated_at", "2019-04-08 08:24:11.182752"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:11.190554"], ["updated_at", "2019-04-08 08:24:11.190554"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.198007"], ["updated_at", "2019-04-08 08:24:11.198007"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.203942"], ["updated_at", "2019-04-08 08:24:11.203942"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:11.212049"], ["updated_at", "2019-04-08 08:24:11.212049"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.219283"], ["updated_at", "2019-04-08 08:24:11.219283"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:11.228356"], ["updated_at", "2019-04-08 08:24:11.228356"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 530], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:11.233505"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 530]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 530], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.242646"], ["updated_at", "2019-04-08 08:24:11.242646"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:24:11.260762"], ["updated_at", "2019-04-08 08:24:11.260762"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798251"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:24:11.269856"], ["updated_at", "2019-04-08 08:24:11.269856"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554625451"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 533], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:11.275870"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554884651"], ["id", 533]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 533]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:11.288494"], ["updated_at", "2019-04-08 08:24:11.288494"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:11.297523"], ["updated_at", "2019-04-08 08:24:11.297523"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (1.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:55.945698"], ["updated_at", "2019-04-08 08:24:55.945698"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:55.995156"], ["updated_at", "2019-04-08 08:24:55.995156"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.017942"], ["updated_at", "2019-04-08 08:24:56.017942"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (2.0ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.054472"], ["updated_at", "2019-04-08 08:24:56.054472"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Load (7.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (4.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (2.4ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Application Exists (4.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.126774"], ["updated_at", "2019-04-08 08:24:56.126774"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.159087"], ["updated_at", "2019-04-08 08:24:56.159087"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.198656"], ["updated_at", "2019-04-08 08:24:56.198656"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.204746"], ["updated_at", "2019-04-08 08:24:56.204746"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:56.223449"], ["updated_at", "2019-04-08 08:24:56.223449"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:56.235064"], ["updated_at", "2019-04-08 08:24:56.235064"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.241356"], ["updated_at", "2019-04-08 08:24:56.241356"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:56.252719"], ["updated_at", "2019-04-08 08:24:56.252719"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.257722"], ["updated_at", "2019-04-08 08:24:56.257722"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:56.266473"], ["updated_at", "2019-04-08 08:24:56.266473"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.276206"], ["updated_at", "2019-04-08 08:24:56.276206"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.292784"], ["updated_at", "2019-04-08 08:24:56.292784"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.298707"], ["updated_at", "2019-04-08 08:24:56.298707"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 544], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:56.306943"], ["id", 544]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.316960"], ["updated_at", "2019-04-08 08:24:56.316960"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.328277"], ["updated_at", "2019-04-08 08:24:56.328277"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 546], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:56.342095"], ["id", 546]]  (1.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 546], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.360241"], ["updated_at", "2019-04-08 08:24:56.360241"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.365164"], ["updated_at", "2019-04-08 08:24:56.365164"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 548], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:56.373218"], ["id", 548]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 548], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.383931"], ["updated_at", "2019-04-08 08:24:56.383931"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.389791"], ["updated_at", "2019-04-08 08:24:56.389791"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:56.398985"], ["updated_at", "2019-04-08 08:24:56.398985"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.406335"], ["updated_at", "2019-04-08 08:24:56.406335"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:56.424618"], ["updated_at", "2019-04-08 08:24:56.424618"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 553], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:56.428619"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 553]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 553], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:56.436690"], ["updated_at", "2019-04-08 08:24:56.436690"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.443369"], ["updated_at", "2019-04-08 08:24:56.443369"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.449036"], ["updated_at", "2019-04-08 08:24:56.449036"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:56.458414"], ["updated_at", "2019-04-08 08:24:56.458414"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:56.462531"], ["updated_at", "2019-04-08 08:24:56.462531"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:56.466571"], ["updated_at", "2019-04-08 08:24:56.466571"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:56.471399"], ["updated_at", "2019-04-08 08:24:56.471399"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:56.480412"], ["updated_at", "2019-04-08 08:24:56.480412"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.487496"], ["updated_at", "2019-04-08 08:24:56.487496"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:24:56.507166"], ["updated_at", "2019-04-08 08:24:56.507166"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554625496"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 560], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:56.512829"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554884696"], ["id", 560]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 560]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:24:56.525998"], ["updated_at", "2019-04-08 08:24:56.525998"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798296"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:56.534212"], ["updated_at", "2019-04-08 08:24:56.534212"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:56.541965"], ["updated_at", "2019-04-08 08:24:56.541965"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:56.578839"], ["updated_at", "2019-04-08 08:24:56.578839"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.2ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:24:57.848114"], ["updated_at", "2019-04-08 08:24:57.848114"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:24:57.851526"], ["synced_id", 0], ["id", 468]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:57.863634"], ["updated_at", "2019-04-08 08:24:57.863634"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798297"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:57.871578"], ["updated_at", "2019-04-08 08:24:57.871578"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554625497"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 470], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:57.877770"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554884697"], ["id", 470]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 470]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:57.890399"], ["updated_at", "2019-04-08 08:24:57.890399"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 471], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:24:57.895741"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 471]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 471], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.906746"], ["updated_at", "2019-04-08 08:24:57.906746"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.913209"], ["updated_at", "2019-04-08 08:24:57.913209"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 473], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:57.922543"], ["id", 473]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.932103"], ["updated_at", "2019-04-08 08:24:57.932103"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.937431"], ["updated_at", "2019-04-08 08:24:57.937431"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 475], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:57.944276"], ["id", 475]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.952639"], ["updated_at", "2019-04-08 08:24:57.952639"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.957191"], ["updated_at", "2019-04-08 08:24:57.957191"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 477], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:57.963156"], ["id", 477]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 477], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.972872"], ["updated_at", "2019-04-08 08:24:57.972872"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.978017"], ["updated_at", "2019-04-08 08:24:57.978017"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 479], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:24:57.983846"], ["id", 479]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 479], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:57.993658"], ["updated_at", "2019-04-08 08:24:57.993658"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:58.001184"], ["updated_at", "2019-04-08 08:24:58.001184"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:58.011272"], ["updated_at", "2019-04-08 08:24:58.011272"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:58.018003"], ["updated_at", "2019-04-08 08:24:58.018003"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:58.027058"], ["updated_at", "2019-04-08 08:24:58.027058"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:58.033115"], ["updated_at", "2019-04-08 08:24:58.033115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:58.043091"], ["updated_at", "2019-04-08 08:24:58.043091"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:58.049373"], ["updated_at", "2019-04-08 08:24:58.049373"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:58.063903"], ["updated_at", "2019-04-08 08:24:58.063903"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:24:58.073980"], ["updated_at", "2019-04-08 08:24:58.073980"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:58.083488"], ["updated_at", "2019-04-08 08:24:58.083488"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:58.093900"], ["updated_at", "2019-04-08 08:24:58.093900"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:58.098592"], ["updated_at", "2019-04-08 08:24:58.098592"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:58.103668"], ["updated_at", "2019-04-08 08:24:58.103668"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.6ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:58.156300"], ["updated_at", "2019-04-08 08:24:58.156300"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.5ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:58.172261"], ["updated_at", "2019-04-08 08:24:58.172261"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:24:58.191113"], ["updated_at", "2019-04-08 08:24:58.191113"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 5.8ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:24:58.218905"], ["updated_at", "2019-04-08 08:24:58.218905"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:24:58.250341"], ["updated_at", "2019-04-08 08:24:58.250341"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:58.276349"], ["updated_at", "2019-04-08 08:24:58.276349"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:24:58.280397"], ["updated_at", "2019-04-08 08:24:58.280397"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:24:58.289303"], ["updated_at", "2019-04-08 08:24:58.289303"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (2.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) ROLLBACK  (1.7ms) BEGIN  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.293203"], ["updated_at", "2019-04-08 08:31:05.293203"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.315297"], ["updated_at", "2019-04-08 08:31:05.315297"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:31:05.339359"], ["updated_at", "2019-04-08 08:31:05.339359"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.346062"], ["updated_at", "2019-04-08 08:31:05.346062"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.349749"], ["updated_at", "2019-04-08 08:31:05.349749"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.364814"], ["updated_at", "2019-04-08 08:31:05.364814"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.369111"], ["updated_at", "2019-04-08 08:31:05.369111"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 572], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:31:05.376101"], ["id", 572]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.401352"], ["updated_at", "2019-04-08 08:31:05.401352"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.405937"], ["updated_at", "2019-04-08 08:31:05.405937"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 574], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:31:05.411801"], ["id", 574]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 574], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.422969"], ["updated_at", "2019-04-08 08:31:05.422969"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.428487"], ["updated_at", "2019-04-08 08:31:05.428487"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 576], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:31:05.438527"], ["id", 576]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 576], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.453043"], ["updated_at", "2019-04-08 08:31:05.453043"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.458663"], ["updated_at", "2019-04-08 08:31:05.458663"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:31:05.471195"], ["updated_at", "2019-04-08 08:31:05.471195"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:31:05.481954"], ["updated_at", "2019-04-08 08:31:05.481954"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.486624"], ["updated_at", "2019-04-08 08:31:05.486624"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:31:05.495802"], ["updated_at", "2019-04-08 08:31:05.495802"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.501138"], ["updated_at", "2019-04-08 08:31:05.501138"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:31:05.511571"], ["updated_at", "2019-04-08 08:31:05.511571"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.516864"], ["updated_at", "2019-04-08 08:31:05.516864"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:31:05.527336"], ["updated_at", "2019-04-08 08:31:05.527336"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554625865"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 587], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:31:05.532780"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885065"], ["id", 587]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 587]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:31:05.545894"], ["updated_at", "2019-04-08 08:31:05.545894"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798665"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.555688"], ["updated_at", "2019-04-08 08:31:05.555688"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.583900"], ["updated_at", "2019-04-08 08:31:05.583900"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.592932"], ["updated_at", "2019-04-08 08:31:05.592932"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.603149"], ["updated_at", "2019-04-08 08:31:05.603149"], ["synced_id", 1], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.609082"], ["updated_at", "2019-04-08 08:31:05.609082"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.613739"], ["updated_at", "2019-04-08 08:31:05.613739"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.619004"], ["updated_at", "2019-04-08 08:31:05.619004"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:31:05.627612"], ["updated_at", "2019-04-08 08:31:05.627612"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 595], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:31:05.632019"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 595]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 595], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.650053"], ["updated_at", "2019-04-08 08:31:05.650053"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.658395"], ["updated_at", "2019-04-08 08:31:05.658395"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.664283"], ["updated_at", "2019-04-08 08:31:05.664283"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.674211"], ["updated_at", "2019-04-08 08:31:05.674211"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:31:05.695772"], ["updated_at", "2019-04-08 08:31:05.695772"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:31:05.699064"], ["synced_id", 0], ["id", 497]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:31:05.708737"], ["updated_at", "2019-04-08 08:31:05.708737"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:31:05.712224"], ["updated_at", "2019-04-08 08:31:05.712224"], ["synced_id", 2]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:31:05.715980"], ["updated_at", "2019-04-08 08:31:05.715980"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:31:05.727699"], ["updated_at", "2019-04-08 08:31:05.727699"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798665"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:31:05.734307"], ["updated_at", "2019-04-08 08:31:05.734307"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554625865"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 502], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:31:05.740282"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885065"], ["id", 502]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 502]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.749941"], ["updated_at", "2019-04-08 08:31:05.749941"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.757474"], ["updated_at", "2019-04-08 08:31:05.757474"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 504], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:31:05.764937"], ["id", 504]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.773610"], ["updated_at", "2019-04-08 08:31:05.773610"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.777602"], ["updated_at", "2019-04-08 08:31:05.777602"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 506], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:31:05.783533"], ["id", 506]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.793726"], ["updated_at", "2019-04-08 08:31:05.793726"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.798319"], ["updated_at", "2019-04-08 08:31:05.798319"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 508], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:31:05.805105"], ["id", 508]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 508], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.815649"], ["updated_at", "2019-04-08 08:31:05.815649"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.821932"], ["updated_at", "2019-04-08 08:31:05.821932"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 510], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:31:05.828272"], ["id", 510]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 510], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.837500"], ["updated_at", "2019-04-08 08:31:05.837500"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:31:05.844071"], ["updated_at", "2019-04-08 08:31:05.844071"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.852620"], ["updated_at", "2019-04-08 08:31:05.852620"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:31:05.857744"], ["updated_at", "2019-04-08 08:31:05.857744"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.864316"], ["updated_at", "2019-04-08 08:31:05.864316"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:31:05.870762"], ["updated_at", "2019-04-08 08:31:05.870762"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:05.877824"], ["updated_at", "2019-04-08 08:31:05.877824"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:31:05.882891"], ["updated_at", "2019-04-08 08:31:05.882891"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:31:05.892090"], ["updated_at", "2019-04-08 08:31:05.892090"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:31:05.899135"], ["updated_at", "2019-04-08 08:31:05.899135"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:31:05.907869"], ["updated_at", "2019-04-08 08:31:05.907869"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:31:05.914871"], ["updated_at", "2019-04-08 08:31:05.914871"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:05.942916"], ["updated_at", "2019-04-08 08:31:05.942916"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 522], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:31:05.947838"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 522]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 522], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:31:05.977740"], ["updated_at", "2019-04-08 08:31:05.977740"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.1ms)  (0.7ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:31:05.990811"], ["updated_at", "2019-04-08 08:31:05.990811"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.2ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:31:06.004157"], ["updated_at", "2019-04-08 08:31:06.004157"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.4ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:31:06.021288"], ["updated_at", "2019-04-08 08:31:06.021288"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 13ms (Views: 8.7ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:31:06.115529"], ["updated_at", "2019-04-08 08:31:06.115529"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:06.129118"], ["updated_at", "2019-04-08 08:31:06.129118"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:31:06.135001"], ["updated_at", "2019-04-08 08:31:06.135001"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:06.149860"], ["updated_at", "2019-04-08 08:31:06.149860"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:06.173435"], ["updated_at", "2019-04-08 08:31:06.173435"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:06.199092"], ["updated_at", "2019-04-08 08:31:06.199092"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:06.220160"], ["updated_at", "2019-04-08 08:31:06.220160"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:06.235859"], ["updated_at", "2019-04-08 08:31:06.235859"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:31:06.257749"], ["updated_at", "2019-04-08 08:31:06.257749"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.3ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.207629"], ["updated_at", "2019-04-08 08:34:03.207629"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.234411"], ["updated_at", "2019-04-08 08:34:03.234411"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.261705"], ["updated_at", "2019-04-08 08:34:03.261705"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.289342"], ["updated_at", "2019-04-08 08:34:03.289342"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.318588"], ["updated_at", "2019-04-08 08:34:03.318588"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.335576"], ["updated_at", "2019-04-08 08:34:03.335576"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.1ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:34:03.416340"], ["updated_at", "2019-04-08 08:34:03.416340"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 8.3ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:34:03.427219"], ["updated_at", "2019-04-08 08:34:03.427219"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.5ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:34:03.458546"], ["updated_at", "2019-04-08 08:34:03.458546"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 6.9ms)  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:34:03.474940"], ["updated_at", "2019-04-08 08:34:03.474940"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.3ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.488279"], ["updated_at", "2019-04-08 08:34:03.488279"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.497558"], ["updated_at", "2019-04-08 08:34:03.497558"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.505043"], ["updated_at", "2019-04-08 08:34:03.505043"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.512303"], ["updated_at", "2019-04-08 08:34:03.512303"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:34:03.520875"], ["updated_at", "2019-04-08 08:34:03.520875"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 603], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:34:03.525070"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 603]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 603], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.534199"], ["updated_at", "2019-04-08 08:34:03.534199"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.550836"], ["updated_at", "2019-04-08 08:34:03.550836"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.555561"], ["updated_at", "2019-04-08 08:34:03.555561"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.559740"], ["updated_at", "2019-04-08 08:34:03.559740"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.565287"], ["updated_at", "2019-04-08 08:34:03.565287"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:34:03.574528"], ["updated_at", "2019-04-08 08:34:03.574528"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:34:03.583317"], ["updated_at", "2019-04-08 08:34:03.583317"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798843"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:34:03.591838"], ["updated_at", "2019-04-08 08:34:03.591838"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626043"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 611], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:34:03.597800"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885243"], ["id", 611]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 611]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.607592"], ["updated_at", "2019-04-08 08:34:03.607592"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.614059"], ["updated_at", "2019-04-08 08:34:03.614059"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.622670"], ["updated_at", "2019-04-08 08:34:03.622670"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.628420"], ["updated_at", "2019-04-08 08:34:03.628420"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.644460"], ["updated_at", "2019-04-08 08:34:03.644460"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.649008"], ["updated_at", "2019-04-08 08:34:03.649008"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:34:03.654572"], ["updated_at", "2019-04-08 08:34:03.654572"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:34:03.664656"], ["updated_at", "2019-04-08 08:34:03.664656"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.668667"], ["updated_at", "2019-04-08 08:34:03.668667"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:34:03.677148"], ["updated_at", "2019-04-08 08:34:03.677148"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.681931"], ["updated_at", "2019-04-08 08:34:03.681931"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:34:03.690797"], ["updated_at", "2019-04-08 08:34:03.690797"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.696517"], ["updated_at", "2019-04-08 08:34:03.696517"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.704026"], ["updated_at", "2019-04-08 08:34:03.704026"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.708320"], ["updated_at", "2019-04-08 08:34:03.708320"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 623], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:34:03.714461"], ["id", 623]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.721327"], ["updated_at", "2019-04-08 08:34:03.721327"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.730948"], ["updated_at", "2019-04-08 08:34:03.730948"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 625], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:34:03.738377"], ["id", 625]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 625], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.748405"], ["updated_at", "2019-04-08 08:34:03.748405"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.752525"], ["updated_at", "2019-04-08 08:34:03.752525"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 627], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:34:03.757770"], ["id", 627]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 627], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.765730"], ["updated_at", "2019-04-08 08:34:03.765730"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.769268"], ["updated_at", "2019-04-08 08:34:03.769268"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:34:03.777408"], ["updated_at", "2019-04-08 08:34:03.777408"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:34:03.784811"], ["updated_at", "2019-04-08 08:34:03.784811"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 531], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:34:03.788673"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 531]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 531], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:34:03.798065"], ["updated_at", "2019-04-08 08:34:03.798065"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:34:03.819380"], ["updated_at", "2019-04-08 08:34:03.819380"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:34:03.823149"], ["updated_at", "2019-04-08 08:34:03.823149"], ["synced_id", 2]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:34:03.826422"], ["updated_at", "2019-04-08 08:34:03.826422"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:34:03.838817"], ["updated_at", "2019-04-08 08:34:03.838817"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:34:03.841823"], ["synced_id", 0], ["id", 536]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.853277"], ["updated_at", "2019-04-08 08:34:03.853277"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.857305"], ["updated_at", "2019-04-08 08:34:03.857305"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 538], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:34:03.863267"], ["id", 538]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.870534"], ["updated_at", "2019-04-08 08:34:03.870534"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.874292"], ["updated_at", "2019-04-08 08:34:03.874292"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 540], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:34:03.879797"], ["id", 540]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.886894"], ["updated_at", "2019-04-08 08:34:03.886894"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.891555"], ["updated_at", "2019-04-08 08:34:03.891555"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 542], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:34:03.897655"], ["id", 542]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 542], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.906480"], ["updated_at", "2019-04-08 08:34:03.906480"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.913312"], ["updated_at", "2019-04-08 08:34:03.913312"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 544], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:34:03.920103"], ["id", 544]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 544], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.929955"], ["updated_at", "2019-04-08 08:34:03.929955"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:34:03.937050"], ["updated_at", "2019-04-08 08:34:03.937050"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.945616"], ["updated_at", "2019-04-08 08:34:03.945616"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:34:03.951535"], ["updated_at", "2019-04-08 08:34:03.951535"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.958959"], ["updated_at", "2019-04-08 08:34:03.958959"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:34:03.965044"], ["updated_at", "2019-04-08 08:34:03.965044"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:03.971691"], ["updated_at", "2019-04-08 08:34:03.971691"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:34:03.976405"], ["updated_at", "2019-04-08 08:34:03.976405"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:34:03.984849"], ["updated_at", "2019-04-08 08:34:03.984849"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:34:03.992727"], ["updated_at", "2019-04-08 08:34:03.992727"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626043"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 553], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:34:04.000606"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885243"], ["id", 553]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 553]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:34:04.012691"], ["updated_at", "2019-04-08 08:34:04.012691"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798844"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:34:04.021688"], ["updated_at", "2019-04-08 08:34:04.021688"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:34:04.052271"], ["updated_at", "2019-04-08 08:34:04.052271"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:04.064509"], ["updated_at", "2019-04-08 08:34:04.064509"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:34:04.070419"], ["updated_at", "2019-04-08 08:34:04.070419"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.3ms) DROP DATABASE IF EXISTS "test"  (396.4ms) CREATE DATABASE "test" ENCODING = 'unicode' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "accounts" CASCADE  (10.8ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)  (3.2ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" ("synced_id")  (0.5ms) DROP TABLE IF EXISTS "applications" CASCADE  (6.2ms) CREATE TABLE "applications" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "host" character varying NOT NULL, "client_id" text NOT NULL, "client_secret" text NOT NULL)  (3.9ms) CREATE UNIQUE INDEX "index_applications_on_client_id" ON "applications" ("client_id")  (2.7ms) CREATE UNIQUE INDEX "index_applications_on_client_secret" ON "applications" ("client_secret")  (3.0ms) CREATE UNIQUE INDEX "index_applications_on_host" ON "applications" ("host")  (0.4ms) DROP TABLE IF EXISTS "multi_applications_accounts" CASCADE  (6.0ms) CREATE TABLE "multi_applications_accounts" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying, "host" character varying NOT NULL)  (3.1ms) CREATE UNIQUE INDEX "index_multi_applications_accounts_on_host_and_synced_id" ON "multi_applications_accounts" ("host", "synced_id")  (3.0ms) CREATE INDEX "index_multi_applications_accounts_on_host" ON "multi_applications_accounts" ("host")  (3.0ms) CREATE INDEX "index_multi_applications_accounts_on_synced_id" ON "multi_applications_accounts" ("synced_id")  (5.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20181130063104)  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454), (20181130062650), (20181130063056), (20140522110326), (20181130062531);   (6.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Create (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2019-04-08 08:34:58.545071"], ["updated_at", "2019-04-08 08:34:58.545071"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:00.666568"], ["updated_at", "2019-04-08 08:35:00.666568"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:00.704754"], ["updated_at", "2019-04-08 08:35:00.704754"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:00.722270"], ["updated_at", "2019-04-08 08:35:00.722270"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:00.754902"], ["updated_at", "2019-04-08 08:35:00.754902"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:00.771369"], ["updated_at", "2019-04-08 08:35:00.771369"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:00.791716"], ["updated_at", "2019-04-08 08:35:00.791716"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:35:00.822293"], ["updated_at", "2019-04-08 08:35:00.822293"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:35:00.852013"], ["updated_at", "2019-04-08 08:35:00.852013"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:35:00.863070"], ["updated_at", "2019-04-08 08:35:00.863070"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:35:00.866876"], ["synced_id", 0], ["id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:35:00.877949"], ["updated_at", "2019-04-08 08:35:00.877949"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:35:00.885303"], ["updated_at", "2019-04-08 08:35:00.885303"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:35:00.895388"], ["updated_at", "2019-04-08 08:35:00.895388"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:35:00.899842"], ["updated_at", "2019-04-08 08:35:00.899842"], ["synced_id", 2]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:35:00.904376"], ["updated_at", "2019-04-08 08:35:00.904376"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:00.913304"], ["updated_at", "2019-04-08 08:35:00.913304"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:35:00.923503"], ["updated_at", "2019-04-08 08:35:00.923503"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:00.931550"], ["updated_at", "2019-04-08 08:35:00.931550"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:35:00.938252"], ["updated_at", "2019-04-08 08:35:00.938252"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:00.945008"], ["updated_at", "2019-04-08 08:35:00.945008"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:35:00.950766"], ["updated_at", "2019-04-08 08:35:00.950766"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:00.958110"], ["updated_at", "2019-04-08 08:35:00.958110"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:35:00.963066"], ["updated_at", "2019-04-08 08:35:00.963066"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:00.978182"], ["updated_at", "2019-04-08 08:35:00.978182"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:00.985691"], ["updated_at", "2019-04-08 08:35:00.985691"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 17], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:35:00.993742"], ["id", 17]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.002619"], ["updated_at", "2019-04-08 08:35:01.002619"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.007430"], ["updated_at", "2019-04-08 08:35:01.007430"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 19], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:35:01.029905"], ["id", 19]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.042781"], ["updated_at", "2019-04-08 08:35:01.042781"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.047691"], ["updated_at", "2019-04-08 08:35:01.047691"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 21], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:35:01.054841"], ["id", 21]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.067424"], ["updated_at", "2019-04-08 08:35:01.067424"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.074074"], ["updated_at", "2019-04-08 08:35:01.074074"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 23], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:35:01.081553"], ["id", 23]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:35:01.091535"], ["updated_at", "2019-04-08 08:35:01.091535"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626101"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 24], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:35:01.097195"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885301"], ["id", 24]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (1.0ms) SAVEPOINT active_record_1 Account Destroy (1.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 24]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:35:01.122080"], ["updated_at", "2019-04-08 08:35:01.122080"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798901"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.129949"], ["updated_at", "2019-04-08 08:35:01.129949"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 26], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:35:01.134564"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 26]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 26], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.151537"], ["updated_at", "2019-04-08 08:35:01.151537"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:35:01.178088"], ["updated_at", "2019-04-08 08:35:01.178088"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.188087"], ["updated_at", "2019-04-08 08:35:01.188087"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.191963"], ["updated_at", "2019-04-08 08:35:01.191963"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.219002"], ["updated_at", "2019-04-08 08:35:01.219002"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.225528"], ["updated_at", "2019-04-08 08:35:01.225528"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.231380"], ["updated_at", "2019-04-08 08:35:01.231380"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.242324"], ["updated_at", "2019-04-08 08:35:01.242324"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.249291"], ["updated_at", "2019-04-08 08:35:01.249291"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:35:01.257936"], ["updated_at", "2019-04-08 08:35:01.257936"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798901"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:35:01.265628"], ["updated_at", "2019-04-08 08:35:01.265628"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626101"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 7], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:35:01.271432"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885301"], ["id", 7]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 7]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.286457"], ["updated_at", "2019-04-08 08:35:01.286457"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.290741"], ["updated_at", "2019-04-08 08:35:01.290741"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.294543"], ["updated_at", "2019-04-08 08:35:01.294543"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.298558"], ["updated_at", "2019-04-08 08:35:01.298558"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:35:01.307998"], ["updated_at", "2019-04-08 08:35:01.307998"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 12], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:35:01.312049"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 12]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 12], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:35:01.326885"], ["updated_at", "2019-04-08 08:35:01.326885"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.335510"], ["updated_at", "2019-04-08 08:35:01.335510"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.345816"], ["updated_at", "2019-04-08 08:35:01.345816"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.363879"], ["updated_at", "2019-04-08 08:35:01.363879"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.369677"], ["updated_at", "2019-04-08 08:35:01.369677"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.378752"], ["updated_at", "2019-04-08 08:35:01.378752"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.383815"], ["updated_at", "2019-04-08 08:35:01.383815"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:35:01.391540"], ["updated_at", "2019-04-08 08:35:01.391540"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:35:01.401901"], ["updated_at", "2019-04-08 08:35:01.401901"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.406321"], ["updated_at", "2019-04-08 08:35:01.406321"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:35:01.415476"], ["updated_at", "2019-04-08 08:35:01.415476"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.420331"], ["updated_at", "2019-04-08 08:35:01.420331"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:35:01.428697"], ["updated_at", "2019-04-08 08:35:01.428697"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.433752"], ["updated_at", "2019-04-08 08:35:01.433752"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.441169"], ["updated_at", "2019-04-08 08:35:01.441169"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.445038"], ["updated_at", "2019-04-08 08:35:01.445038"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 26], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:35:01.451177"], ["id", 26]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.459192"], ["updated_at", "2019-04-08 08:35:01.459192"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.463224"], ["updated_at", "2019-04-08 08:35:01.463224"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 28], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:35:01.469547"], ["id", 28]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 28], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.479554"], ["updated_at", "2019-04-08 08:35:01.479554"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:35:01.485641"], ["updated_at", "2019-04-08 08:35:01.485641"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 30], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:35:01.491585"], ["id", 30]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 30], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:35:01.501222"], ["updated_at", "2019-04-08 08:35:01.501222"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:35:01.524316"], ["updated_at", "2019-04-08 08:35:01.524316"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.9ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:35:01.535548"], ["updated_at", "2019-04-08 08:35:01.535548"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:35:01.549947"], ["updated_at", "2019-04-08 08:35:01.549947"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:35:01.568977"], ["updated_at", "2019-04-08 08:35:01.568977"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:00.080635"], ["updated_at", "2019-04-08 08:36:00.080635"], ["synced_id", 123]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (6.5ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:00.130113"], ["updated_at", "2019-04-08 08:36:00.130113"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:00.140837"], ["updated_at", "2019-04-08 08:36:00.140837"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626160"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 32], ["LIMIT", 1]] Account Update (2.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:00.151957"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885360"], ["id", 32]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 32]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:00.171525"], ["updated_at", "2019-04-08 08:36:00.171525"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798960"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:00.179838"], ["updated_at", "2019-04-08 08:36:00.179838"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:00.188770"], ["updated_at", "2019-04-08 08:36:00.188770"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.196797"], ["updated_at", "2019-04-08 08:36:00.196797"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:00.208453"], ["updated_at", "2019-04-08 08:36:00.208453"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.218966"], ["updated_at", "2019-04-08 08:36:00.218966"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:00.225476"], ["updated_at", "2019-04-08 08:36:00.225476"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.234150"], ["updated_at", "2019-04-08 08:36:00.234150"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:00.242121"], ["updated_at", "2019-04-08 08:36:00.242121"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.252321"], ["updated_at", "2019-04-08 08:36:00.252321"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:00.258663"], ["updated_at", "2019-04-08 08:36:00.258663"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.265924"], ["updated_at", "2019-04-08 08:36:00.265924"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.270983"], ["updated_at", "2019-04-08 08:36:00.270983"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 45], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:00.276450"], ["id", 45]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.283484"], ["updated_at", "2019-04-08 08:36:00.283484"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.288078"], ["updated_at", "2019-04-08 08:36:00.288078"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 47], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:00.294401"], ["id", 47]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 47], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.305406"], ["updated_at", "2019-04-08 08:36:00.305406"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.310561"], ["updated_at", "2019-04-08 08:36:00.310561"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 49], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:00.319211"], ["id", 49]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 49], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.327781"], ["updated_at", "2019-04-08 08:36:00.327781"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.332643"], ["updated_at", "2019-04-08 08:36:00.332643"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 51], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:00.338419"], ["id", 51]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:36:00.348674"], ["updated_at", "2019-04-08 08:36:00.348674"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:36:00.352250"], ["synced_id", 0], ["id", 52]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:00.367016"], ["updated_at", "2019-04-08 08:36:00.367016"], ["synced_id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:00.372437"], ["updated_at", "2019-04-08 08:36:00.372437"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:00.376389"], ["updated_at", "2019-04-08 08:36:00.376389"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.384868"], ["updated_at", "2019-04-08 08:36:00.384868"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 56], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:00.389330"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 56]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 56], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.408161"], ["updated_at", "2019-04-08 08:36:00.408161"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.425394"], ["updated_at", "2019-04-08 08:36:00.425394"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.442057"], ["updated_at", "2019-04-08 08:36:00.442057"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.464654"], ["updated_at", "2019-04-08 08:36:00.464654"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.484915"], ["updated_at", "2019-04-08 08:36:00.484915"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.504495"], ["updated_at", "2019-04-08 08:36:00.504495"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:00.595767"], ["updated_at", "2019-04-08 08:36:00.595767"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.6ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:00.607791"], ["updated_at", "2019-04-08 08:36:00.607791"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:00.624681"], ["updated_at", "2019-04-08 08:36:00.624681"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 4.3ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:00.646213"], ["updated_at", "2019-04-08 08:36:00.646213"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.6ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.657039"], ["updated_at", "2019-04-08 08:36:00.657039"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.663017"], ["updated_at", "2019-04-08 08:36:00.663017"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.673305"], ["updated_at", "2019-04-08 08:36:00.673305"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.678035"], ["updated_at", "2019-04-08 08:36:00.678035"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.687418"], ["updated_at", "2019-04-08 08:36:00.687418"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.692022"], ["updated_at", "2019-04-08 08:36:00.692022"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:00.698884"], ["updated_at", "2019-04-08 08:36:00.698884"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:00.708367"], ["updated_at", "2019-04-08 08:36:00.708367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.712189"], ["updated_at", "2019-04-08 08:36:00.712189"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:00.719992"], ["updated_at", "2019-04-08 08:36:00.719992"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.724055"], ["updated_at", "2019-04-08 08:36:00.724055"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:00.732121"], ["updated_at", "2019-04-08 08:36:00.732121"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.737771"], ["updated_at", "2019-04-08 08:36:00.737771"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.747029"], ["updated_at", "2019-04-08 08:36:00.747029"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.750852"], ["updated_at", "2019-04-08 08:36:00.750852"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 48], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:00.757361"], ["id", 48]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.764992"], ["updated_at", "2019-04-08 08:36:00.764992"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.768796"], ["updated_at", "2019-04-08 08:36:00.768796"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 50], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:00.775049"], ["id", 50]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 50], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.783611"], ["updated_at", "2019-04-08 08:36:00.783611"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.788564"], ["updated_at", "2019-04-08 08:36:00.788564"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 52], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:00.794231"], ["id", 52]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 52], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.802666"], ["updated_at", "2019-04-08 08:36:00.802666"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.823424"], ["updated_at", "2019-04-08 08:36:00.823424"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.834203"], ["updated_at", "2019-04-08 08:36:00.834203"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:00.845960"], ["updated_at", "2019-04-08 08:36:00.845960"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798960"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:00.853887"], ["updated_at", "2019-04-08 08:36:00.853887"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626160"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 57], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:00.858785"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885360"], ["id", 57]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 57]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.869274"], ["updated_at", "2019-04-08 08:36:00.869274"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.876682"], ["updated_at", "2019-04-08 08:36:00.876682"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.882923"], ["updated_at", "2019-04-08 08:36:00.882923"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.890627"], ["updated_at", "2019-04-08 08:36:00.890627"], ["synced_id", 1], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.894524"], ["updated_at", "2019-04-08 08:36:00.894524"], ["synced_id", 2], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.898234"], ["updated_at", "2019-04-08 08:36:00.898234"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.901746"], ["updated_at", "2019-04-08 08:36:00.901746"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:00.910395"], ["updated_at", "2019-04-08 08:36:00.910395"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 63], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:00.929614"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 63]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 63], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:00.941464"], ["updated_at", "2019-04-08 08:36:00.941464"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:00.956987"], ["updated_at", "2019-04-08 08:36:00.956987"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:00.975491"], ["updated_at", "2019-04-08 08:36:00.975491"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.991491"], ["updated_at", "2019-04-08 08:36:00.991491"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:00.998641"], ["updated_at", "2019-04-08 08:36:00.998641"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:18.975854"], ["updated_at", "2019-04-08 08:36:18.975854"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:18.983164"], ["updated_at", "2019-04-08 08:36:18.983164"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:19.008164"], ["updated_at", "2019-04-08 08:36:19.008164"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.028282"], ["updated_at", "2019-04-08 08:36:19.028282"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.048483"], ["updated_at", "2019-04-08 08:36:19.048483"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.068668"], ["updated_at", "2019-04-08 08:36:19.068668"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.085278"], ["updated_at", "2019-04-08 08:36:19.085278"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.117855"], ["updated_at", "2019-04-08 08:36:19.117855"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.138627"], ["updated_at", "2019-04-08 08:36:19.138627"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.150958"], ["updated_at", "2019-04-08 08:36:19.150958"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.155194"], ["updated_at", "2019-04-08 08:36:19.155194"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.159567"], ["updated_at", "2019-04-08 08:36:19.159567"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.163266"], ["updated_at", "2019-04-08 08:36:19.163266"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.172330"], ["updated_at", "2019-04-08 08:36:19.172330"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.178100"], ["updated_at", "2019-04-08 08:36:19.178100"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.188921"], ["updated_at", "2019-04-08 08:36:19.188921"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.193556"], ["updated_at", "2019-04-08 08:36:19.193556"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:19.203548"], ["updated_at", "2019-04-08 08:36:19.203548"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:19.214517"], ["updated_at", "2019-04-08 08:36:19.214517"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.220191"], ["updated_at", "2019-04-08 08:36:19.220191"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:19.229303"], ["updated_at", "2019-04-08 08:36:19.229303"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.234404"], ["updated_at", "2019-04-08 08:36:19.234404"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:19.244746"], ["updated_at", "2019-04-08 08:36:19.244746"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.250568"], ["updated_at", "2019-04-08 08:36:19.250568"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.260039"], ["updated_at", "2019-04-08 08:36:19.260039"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.264520"], ["updated_at", "2019-04-08 08:36:19.264520"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 84], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:19.273176"], ["id", 84]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.281467"], ["updated_at", "2019-04-08 08:36:19.281467"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.287958"], ["updated_at", "2019-04-08 08:36:19.287958"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 86], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:19.294236"], ["id", 86]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 86], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.304318"], ["updated_at", "2019-04-08 08:36:19.304318"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.308424"], ["updated_at", "2019-04-08 08:36:19.308424"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 88], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:19.313876"], ["id", 88]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 88], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.324954"], ["updated_at", "2019-04-08 08:36:19.324954"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.331527"], ["updated_at", "2019-04-08 08:36:19.331527"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.344532"], ["updated_at", "2019-04-08 08:36:19.344532"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.372661"], ["updated_at", "2019-04-08 08:36:19.372661"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.380476"], ["updated_at", "2019-04-08 08:36:19.380476"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.388756"], ["updated_at", "2019-04-08 08:36:19.388756"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:19.397312"], ["updated_at", "2019-04-08 08:36:19.397312"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 93], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:19.402422"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 93]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 93], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.411222"], ["updated_at", "2019-04-08 08:36:19.411222"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.418552"], ["updated_at", "2019-04-08 08:36:19.418552"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:19.427195"], ["updated_at", "2019-04-08 08:36:19.427195"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:19.436265"], ["updated_at", "2019-04-08 08:36:19.436265"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798979"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:19.443826"], ["updated_at", "2019-04-08 08:36:19.443826"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626179"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 97], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:19.449641"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885379"], ["id", 97]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 97]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:19.510754"], ["updated_at", "2019-04-08 08:36:19.510754"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 5.1ms)  (1.5ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:19.526585"], ["updated_at", "2019-04-08 08:36:19.526585"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.2ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 Account Exists (3.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:19.551101"], ["updated_at", "2019-04-08 08:36:19.551101"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 12.5ms)  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:19.579319"], ["updated_at", "2019-04-08 08:36:19.579319"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.2ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.629681"], ["updated_at", "2019-04-08 08:36:19.629681"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:19.642997"], ["updated_at", "2019-04-08 08:36:19.642997"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:19.663656"], ["updated_at", "2019-04-08 08:36:19.663656"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 66], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:19.668904"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 66]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 66], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:19.680559"], ["updated_at", "2019-04-08 08:36:19.680559"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:36:19.693467"], ["updated_at", "2019-04-08 08:36:19.693467"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:36:19.697037"], ["synced_id", 0], ["id", 68]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:19.708576"], ["updated_at", "2019-04-08 08:36:19.708576"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:19.717565"], ["updated_at", "2019-04-08 08:36:19.717565"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:19.722589"], ["updated_at", "2019-04-08 08:36:19.722589"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:19.726820"], ["updated_at", "2019-04-08 08:36:19.726820"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:19.735234"], ["updated_at", "2019-04-08 08:36:19.735234"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626179"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 72], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:19.740398"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885379"], ["id", 72]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 72]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:19.750664"], ["updated_at", "2019-04-08 08:36:19.750664"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798979"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.758060"], ["updated_at", "2019-04-08 08:36:19.758060"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.762582"], ["updated_at", "2019-04-08 08:36:19.762582"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 75], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:19.769849"], ["id", 75]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.778435"], ["updated_at", "2019-04-08 08:36:19.778435"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.783470"], ["updated_at", "2019-04-08 08:36:19.783470"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 77], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:19.789856"], ["id", 77]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 77], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.797704"], ["updated_at", "2019-04-08 08:36:19.797704"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.802467"], ["updated_at", "2019-04-08 08:36:19.802467"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 79], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:19.807975"], ["id", 79]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 79], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.818002"], ["updated_at", "2019-04-08 08:36:19.818002"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.823754"], ["updated_at", "2019-04-08 08:36:19.823754"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 81], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:19.830922"], ["id", 81]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.839848"], ["updated_at", "2019-04-08 08:36:19.839848"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:19.846130"], ["updated_at", "2019-04-08 08:36:19.846130"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.852953"], ["updated_at", "2019-04-08 08:36:19.852953"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:19.858488"], ["updated_at", "2019-04-08 08:36:19.858488"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.865473"], ["updated_at", "2019-04-08 08:36:19.865473"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:19.871604"], ["updated_at", "2019-04-08 08:36:19.871604"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:19.878464"], ["updated_at", "2019-04-08 08:36:19.878464"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:19.884560"], ["updated_at", "2019-04-08 08:36:19.884560"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:19.891851"], ["updated_at", "2019-04-08 08:36:19.891851"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.302495"], ["updated_at", "2019-04-08 08:36:32.302495"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.354180"], ["updated_at", "2019-04-08 08:36:32.354180"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:32.368612"], ["updated_at", "2019-04-08 08:36:32.368612"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (1.2ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.378713"], ["updated_at", "2019-04-08 08:36:32.378713"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:32.386134"], ["updated_at", "2019-04-08 08:36:32.386134"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.396636"], ["updated_at", "2019-04-08 08:36:32.396636"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:32.403036"], ["updated_at", "2019-04-08 08:36:32.403036"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.412573"], ["updated_at", "2019-04-08 08:36:32.412573"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:32.421452"], ["updated_at", "2019-04-08 08:36:32.421452"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.440508"], ["updated_at", "2019-04-08 08:36:32.440508"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.445876"], ["updated_at", "2019-04-08 08:36:32.445876"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 100], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:32.452125"], ["id", 100]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.460557"], ["updated_at", "2019-04-08 08:36:32.460557"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.465011"], ["updated_at", "2019-04-08 08:36:32.465011"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 102], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:32.470429"], ["id", 102]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.478837"], ["updated_at", "2019-04-08 08:36:32.478837"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.483243"], ["updated_at", "2019-04-08 08:36:32.483243"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 104], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:32.489658"], ["id", 104]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 104], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.499956"], ["updated_at", "2019-04-08 08:36:32.499956"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:32.504718"], ["updated_at", "2019-04-08 08:36:32.504718"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 106], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:32.510853"], ["id", 106]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 106], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:32.532423"], ["updated_at", "2019-04-08 08:36:32.532423"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.541287"], ["updated_at", "2019-04-08 08:36:32.541287"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 107], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:32.545708"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 107]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 107], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:32.556208"], ["updated_at", "2019-04-08 08:36:32.556208"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626192"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 108], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:32.561328"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885392"], ["id", 108]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 108]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:32.573563"], ["updated_at", "2019-04-08 08:36:32.573563"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798992"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:32.582155"], ["updated_at", "2019-04-08 08:36:32.582155"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:32.613470"], ["updated_at", "2019-04-08 08:36:32.613470"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:32.621441"], ["updated_at", "2019-04-08 08:36:32.621441"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:32.625424"], ["updated_at", "2019-04-08 08:36:32.625424"], ["synced_id", 2]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (2.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:32.633842"], ["updated_at", "2019-04-08 08:36:32.633842"], ["synced_id", 3]]  (2.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:32.653523"], ["updated_at", "2019-04-08 08:36:32.653523"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:36:32.666566"], ["updated_at", "2019-04-08 08:36:32.666566"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:36:32.671154"], ["synced_id", 0], ["id", 116]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.692556"], ["updated_at", "2019-04-08 08:36:32.692556"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.718435"], ["updated_at", "2019-04-08 08:36:32.718435"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.738853"], ["updated_at", "2019-04-08 08:36:32.738853"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.756574"], ["updated_at", "2019-04-08 08:36:32.756574"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.784876"], ["updated_at", "2019-04-08 08:36:32.784876"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.809154"], ["updated_at", "2019-04-08 08:36:32.809154"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:32.867238"], ["updated_at", "2019-04-08 08:36:32.867238"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:32.878817"], ["updated_at", "2019-04-08 08:36:32.878817"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:32.895297"], ["updated_at", "2019-04-08 08:36:32.895297"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 4.9ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:32.912273"], ["updated_at", "2019-04-08 08:36:32.912273"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.6ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:32.948948"], ["updated_at", "2019-04-08 08:36:32.948948"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 102], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:32.953613"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 102]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 102], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.964417"], ["updated_at", "2019-04-08 08:36:32.964417"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.968848"], ["updated_at", "2019-04-08 08:36:32.968848"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:32.977279"], ["updated_at", "2019-04-08 08:36:32.977279"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:32.989590"], ["updated_at", "2019-04-08 08:36:32.989590"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:32.994499"], ["updated_at", "2019-04-08 08:36:32.994499"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:33.003699"], ["updated_at", "2019-04-08 08:36:33.003699"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.009053"], ["updated_at", "2019-04-08 08:36:33.009053"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:33.017800"], ["updated_at", "2019-04-08 08:36:33.017800"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.023235"], ["updated_at", "2019-04-08 08:36:33.023235"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.031611"], ["updated_at", "2019-04-08 08:36:33.031611"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.036396"], ["updated_at", "2019-04-08 08:36:33.036396"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 112], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:33.045234"], ["id", 112]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.052985"], ["updated_at", "2019-04-08 08:36:33.052985"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.061271"], ["updated_at", "2019-04-08 08:36:33.061271"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (3.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 114], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:33.073957"], ["id", 114]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 114], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.085511"], ["updated_at", "2019-04-08 08:36:33.085511"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.090877"], ["updated_at", "2019-04-08 08:36:33.090877"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 116], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:33.096671"], ["id", 116]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 116], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.107529"], ["updated_at", "2019-04-08 08:36:33.107529"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.112637"], ["updated_at", "2019-04-08 08:36:33.112637"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.123093"], ["updated_at", "2019-04-08 08:36:33.123093"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.142221"], ["updated_at", "2019-04-08 08:36:33.142221"], ["synced_id", 123], ["host", "test.example"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.152575"], ["updated_at", "2019-04-08 08:36:33.152575"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.159716"], ["updated_at", "2019-04-08 08:36:33.159716"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:33.168640"], ["updated_at", "2019-04-08 08:36:33.168640"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626193"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 122], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:33.173607"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885393"], ["id", 122]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 122]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:33.183325"], ["updated_at", "2019-04-08 08:36:33.183325"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554798993"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.194037"], ["updated_at", "2019-04-08 08:36:33.194037"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.201727"], ["updated_at", "2019-04-08 08:36:33.201727"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:33.212129"], ["updated_at", "2019-04-08 08:36:33.212129"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.220189"], ["updated_at", "2019-04-08 08:36:33.220189"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:33.229592"], ["updated_at", "2019-04-08 08:36:33.229592"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.241259"], ["updated_at", "2019-04-08 08:36:33.241259"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.246128"], ["updated_at", "2019-04-08 08:36:33.246128"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.250900"], ["updated_at", "2019-04-08 08:36:33.250900"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.255359"], ["updated_at", "2019-04-08 08:36:33.255359"], ["synced_id", 2], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.287031"], ["updated_at", "2019-04-08 08:36:33.287031"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:33.292263"], ["updated_at", "2019-04-08 08:36:33.292263"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:33.301340"], ["updated_at", "2019-04-08 08:36:33.301340"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.9ms) ROLLBACK  (1.3ms) BEGIN  (1.7ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (3.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.073930"], ["updated_at", "2019-04-08 08:36:42.073930"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.120774"], ["updated_at", "2019-04-08 08:36:42.120774"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.141882"], ["updated_at", "2019-04-08 08:36:42.141882"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.159888"], ["updated_at", "2019-04-08 08:36:42.159888"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.183741"], ["updated_at", "2019-04-08 08:36:42.183741"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.206019"], ["updated_at", "2019-04-08 08:36:42.206019"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:42.253007"], ["updated_at", "2019-04-08 08:36:42.253007"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 20ms (ActiveRecord: 8.8ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:42.264386"], ["updated_at", "2019-04-08 08:36:42.264386"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.6ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:42.280154"], ["updated_at", "2019-04-08 08:36:42.280154"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:42.307778"], ["updated_at", "2019-04-08 08:36:42.307778"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 6.3ms)  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 5.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:42.338341"], ["updated_at", "2019-04-08 08:36:42.338341"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:42.342802"], ["updated_at", "2019-04-08 08:36:42.342802"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:42.346806"], ["updated_at", "2019-04-08 08:36:42.346806"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:42.355476"], ["updated_at", "2019-04-08 08:36:42.355476"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626202"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 127], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:42.361317"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885402"], ["id", 127]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 127]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:42.371692"], ["updated_at", "2019-04-08 08:36:42.371692"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799002"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:36:42.383192"], ["updated_at", "2019-04-08 08:36:42.383192"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:36:42.386562"], ["synced_id", 0], ["id", 129]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:42.396989"], ["updated_at", "2019-04-08 08:36:42.396989"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.403279"], ["updated_at", "2019-04-08 08:36:42.403279"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 131], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:42.407531"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 131]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 131], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:42.416490"], ["updated_at", "2019-04-08 08:36:42.416490"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:42.423929"], ["updated_at", "2019-04-08 08:36:42.423929"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:42.438944"], ["updated_at", "2019-04-08 08:36:42.438944"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.6ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.464665"], ["updated_at", "2019-04-08 08:36:42.464665"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.469804"], ["updated_at", "2019-04-08 08:36:42.469804"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 135], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:42.475737"], ["id", 135]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.482692"], ["updated_at", "2019-04-08 08:36:42.482692"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.486526"], ["updated_at", "2019-04-08 08:36:42.486526"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 137], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:42.492732"], ["id", 137]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 137], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.500676"], ["updated_at", "2019-04-08 08:36:42.500676"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.504887"], ["updated_at", "2019-04-08 08:36:42.504887"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 139], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:42.510154"], ["id", 139]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 139], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.519411"], ["updated_at", "2019-04-08 08:36:42.519411"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.523683"], ["updated_at", "2019-04-08 08:36:42.523683"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 141], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:42.528803"], ["id", 141]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.536692"], ["updated_at", "2019-04-08 08:36:42.536692"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:42.546870"], ["updated_at", "2019-04-08 08:36:42.546870"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.555957"], ["updated_at", "2019-04-08 08:36:42.555957"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:42.561485"], ["updated_at", "2019-04-08 08:36:42.561485"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.569273"], ["updated_at", "2019-04-08 08:36:42.569273"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:42.574934"], ["updated_at", "2019-04-08 08:36:42.574934"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.585409"], ["updated_at", "2019-04-08 08:36:42.585409"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:36:42.598536"], ["updated_at", "2019-04-08 08:36:42.598536"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.638617"], ["updated_at", "2019-04-08 08:36:42.638617"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:42.652266"], ["updated_at", "2019-04-08 08:36:42.652266"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626202"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 135], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:42.659265"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885402"], ["id", 135]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 135]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:36:42.671295"], ["updated_at", "2019-04-08 08:36:42.671295"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799002"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.683491"], ["updated_at", "2019-04-08 08:36:42.683491"], ["synced_id", 123], ["host", "test.example"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.697969"], ["updated_at", "2019-04-08 08:36:42.697969"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:42.709689"], ["updated_at", "2019-04-08 08:36:42.709689"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:36:42.718116"], ["updated_at", "2019-04-08 08:36:42.718116"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 139], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:36:42.724435"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 139]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 139], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.734862"], ["updated_at", "2019-04-08 08:36:42.734862"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.743173"], ["updated_at", "2019-04-08 08:36:42.743173"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.753229"], ["updated_at", "2019-04-08 08:36:42.753229"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.758064"], ["updated_at", "2019-04-08 08:36:42.758064"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.762386"], ["updated_at", "2019-04-08 08:36:42.762386"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.766333"], ["updated_at", "2019-04-08 08:36:42.766333"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.778136"], ["updated_at", "2019-04-08 08:36:42.778136"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.784300"], ["updated_at", "2019-04-08 08:36:42.784300"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.794584"], ["updated_at", "2019-04-08 08:36:42.794584"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.798739"], ["updated_at", "2019-04-08 08:36:42.798739"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:42.808400"], ["updated_at", "2019-04-08 08:36:42.808400"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (7.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:42.830268"], ["updated_at", "2019-04-08 08:36:42.830268"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.835932"], ["updated_at", "2019-04-08 08:36:42.835932"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:42.845144"], ["updated_at", "2019-04-08 08:36:42.845144"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.849230"], ["updated_at", "2019-04-08 08:36:42.849230"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:36:42.859272"], ["updated_at", "2019-04-08 08:36:42.859272"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.863707"], ["updated_at", "2019-04-08 08:36:42.863707"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.871263"], ["updated_at", "2019-04-08 08:36:42.871263"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.875646"], ["updated_at", "2019-04-08 08:36:42.875646"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 156], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:42.880897"], ["id", 156]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.888364"], ["updated_at", "2019-04-08 08:36:42.888364"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.892962"], ["updated_at", "2019-04-08 08:36:42.892962"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 158], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:42.898100"], ["id", 158]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 158], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.907195"], ["updated_at", "2019-04-08 08:36:42.907195"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.911328"], ["updated_at", "2019-04-08 08:36:42.911328"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 160], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:36:42.916205"], ["id", 160]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 160], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.926007"], ["updated_at", "2019-04-08 08:36:42.926007"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.931985"], ["updated_at", "2019-04-08 08:36:42.931985"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.939365"], ["updated_at", "2019-04-08 08:36:42.939365"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:36:42.947580"], ["updated_at", "2019-04-08 08:36:42.947580"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.968837"], ["updated_at", "2019-04-08 08:36:42.968837"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:36:42.974296"], ["updated_at", "2019-04-08 08:36:42.974296"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:36:42.984254"], ["updated_at", "2019-04-08 08:36:42.984254"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:37:16.860057"], ["updated_at", "2019-04-08 08:37:16.860057"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.894399"], ["updated_at", "2019-04-08 08:37:16.894399"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.897985"], ["updated_at", "2019-04-08 08:37:16.897985"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 153], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:37:16.906443"], ["id", 153]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 153], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.915182"], ["updated_at", "2019-04-08 08:37:16.915182"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.918601"], ["updated_at", "2019-04-08 08:37:16.918601"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 155], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:37:16.923534"], ["id", 155]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 155], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.934549"], ["updated_at", "2019-04-08 08:37:16.934549"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.941938"], ["updated_at", "2019-04-08 08:37:16.941938"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 157], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:37:16.950041"], ["id", 157]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.959831"], ["updated_at", "2019-04-08 08:37:16.959831"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.964226"], ["updated_at", "2019-04-08 08:37:16.964226"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 159], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:37:16.970985"], ["id", 159]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.979343"], ["updated_at", "2019-04-08 08:37:16.979343"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:37:16.988628"], ["updated_at", "2019-04-08 08:37:16.988628"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:16.996821"], ["updated_at", "2019-04-08 08:37:16.996821"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:37:17.002446"], ["updated_at", "2019-04-08 08:37:17.002446"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.010013"], ["updated_at", "2019-04-08 08:37:17.010013"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:37:17.014968"], ["updated_at", "2019-04-08 08:37:17.014968"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.023625"], ["updated_at", "2019-04-08 08:37:17.023625"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:37:17.030328"], ["updated_at", "2019-04-08 08:37:17.030328"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:37:17.057214"], ["updated_at", "2019-04-08 08:37:17.057214"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:37:17.067383"], ["updated_at", "2019-04-08 08:37:17.067383"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626237"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 168], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:37:17.087419"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885437"], ["id", 168]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 168]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:37:17.100662"], ["updated_at", "2019-04-08 08:37:17.100662"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799037"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:37:17.122734"], ["updated_at", "2019-04-08 08:37:17.122734"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:37:17.131371"], ["updated_at", "2019-04-08 08:37:17.131371"], ["synced_id", 1]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:37:17.137080"], ["updated_at", "2019-04-08 08:37:17.137080"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:37:17.143217"], ["updated_at", "2019-04-08 08:37:17.143217"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (1.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:37:17.159137"], ["updated_at", "2019-04-08 08:37:17.159137"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:37:17.165990"], ["synced_id", 0], ["id", 174]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:37:17.189390"], ["updated_at", "2019-04-08 08:37:17.189390"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.198039"], ["updated_at", "2019-04-08 08:37:17.198039"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 176], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:37:17.204378"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 176]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 176], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:37:17.222890"], ["updated_at", "2019-04-08 08:37:17.222890"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:37:17.236496"], ["updated_at", "2019-04-08 08:37:17.236496"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:37:17.253905"], ["updated_at", "2019-04-08 08:37:17.253905"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.4ms)  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:37:17.274250"], ["updated_at", "2019-04-08 08:37:17.274250"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.2ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.325540"], ["updated_at", "2019-04-08 08:37:17.325540"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.354112"], ["updated_at", "2019-04-08 08:37:17.354112"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.376649"], ["updated_at", "2019-04-08 08:37:17.376649"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.395069"], ["updated_at", "2019-04-08 08:37:17.395069"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.415639"], ["updated_at", "2019-04-08 08:37:17.415639"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.439705"], ["updated_at", "2019-04-08 08:37:17.439705"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.458624"], ["updated_at", "2019-04-08 08:37:17.458624"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.462669"], ["updated_at", "2019-04-08 08:37:17.462669"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:37:17.474512"], ["updated_at", "2019-04-08 08:37:17.474512"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:37:17.528883"], ["updated_at", "2019-04-08 08:37:17.528883"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:37:17.536227"], ["updated_at", "2019-04-08 08:37:17.536227"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 171], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:37:17.541165"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 171]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 171], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.551089"], ["updated_at", "2019-04-08 08:37:17.551089"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.557629"], ["updated_at", "2019-04-08 08:37:17.557629"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.567733"], ["updated_at", "2019-04-08 08:37:17.567733"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.573084"], ["updated_at", "2019-04-08 08:37:17.573084"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.585420"], ["updated_at", "2019-04-08 08:37:17.585420"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.591743"], ["updated_at", "2019-04-08 08:37:17.591743"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 175], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:37:17.598924"], ["id", 175]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.607303"], ["updated_at", "2019-04-08 08:37:17.607303"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.611675"], ["updated_at", "2019-04-08 08:37:17.611675"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 177], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:37:17.617250"], ["id", 177]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 177], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.625633"], ["updated_at", "2019-04-08 08:37:17.625633"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.629797"], ["updated_at", "2019-04-08 08:37:17.629797"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 179], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:37:17.635321"], ["id", 179]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 179], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.642979"], ["updated_at", "2019-04-08 08:37:17.642979"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.646414"], ["updated_at", "2019-04-08 08:37:17.646414"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:37:17.652735"], ["updated_at", "2019-04-08 08:37:17.652735"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:37:17.662217"], ["updated_at", "2019-04-08 08:37:17.662217"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.667061"], ["updated_at", "2019-04-08 08:37:17.667061"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:37:17.676405"], ["updated_at", "2019-04-08 08:37:17.676405"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.680536"], ["updated_at", "2019-04-08 08:37:17.680536"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:37:17.688731"], ["updated_at", "2019-04-08 08:37:17.688731"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.692921"], ["updated_at", "2019-04-08 08:37:17.692921"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.700371"], ["updated_at", "2019-04-08 08:37:17.700371"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.704349"], ["updated_at", "2019-04-08 08:37:17.704349"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.708018"], ["updated_at", "2019-04-08 08:37:17.708018"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.711740"], ["updated_at", "2019-04-08 08:37:17.711740"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.720856"], ["updated_at", "2019-04-08 08:37:17.720856"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.730281"], ["updated_at", "2019-04-08 08:37:17.730281"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.738318"], ["updated_at", "2019-04-08 08:37:17.738318"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:37:17.746542"], ["updated_at", "2019-04-08 08:37:17.746542"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.753047"], ["updated_at", "2019-04-08 08:37:17.753047"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:37:17.762441"], ["updated_at", "2019-04-08 08:37:17.762441"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626237"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 196], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:37:17.767354"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885437"], ["id", 196]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 196]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:37:17.777829"], ["updated_at", "2019-04-08 08:37:17.777829"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799037"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.784729"], ["updated_at", "2019-04-08 08:37:17.784729"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:37:17.804196"], ["updated_at", "2019-04-08 08:37:17.804196"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:40:26.547758"], ["updated_at", "2019-04-08 08:40:26.547758"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 199], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:40:26.552856"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 199]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 199], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:40:26.564716"], ["updated_at", "2019-04-08 08:40:26.564716"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799226"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:40:26.597549"], ["updated_at", "2019-04-08 08:40:26.597549"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626426"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 201], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:40:26.604704"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885626"], ["id", 201]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 201]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.619283"], ["updated_at", "2019-04-08 08:40:26.619283"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.625766"], ["updated_at", "2019-04-08 08:40:26.625766"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.638240"], ["updated_at", "2019-04-08 08:40:26.638240"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.645397"], ["updated_at", "2019-04-08 08:40:26.645397"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 204], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:40:26.655554"], ["id", 204]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.664901"], ["updated_at", "2019-04-08 08:40:26.664901"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.669620"], ["updated_at", "2019-04-08 08:40:26.669620"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 206], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:40:26.676030"], ["id", 206]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 206], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.684973"], ["updated_at", "2019-04-08 08:40:26.684973"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.689099"], ["updated_at", "2019-04-08 08:40:26.689099"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 208], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:40:26.694322"], ["id", 208]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 208], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.704806"], ["updated_at", "2019-04-08 08:40:26.704806"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.710484"], ["updated_at", "2019-04-08 08:40:26.710484"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:40:26.723230"], ["updated_at", "2019-04-08 08:40:26.723230"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:40:26.737420"], ["updated_at", "2019-04-08 08:40:26.737420"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.743225"], ["updated_at", "2019-04-08 08:40:26.743225"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.2ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:40:26.756679"], ["updated_at", "2019-04-08 08:40:26.756679"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.762109"], ["updated_at", "2019-04-08 08:40:26.762109"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:40:26.774168"], ["updated_at", "2019-04-08 08:40:26.774168"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.780646"], ["updated_at", "2019-04-08 08:40:26.780646"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:26.789614"], ["updated_at", "2019-04-08 08:40:26.789614"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.813441"], ["updated_at", "2019-04-08 08:40:26.813441"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:26.830127"], ["updated_at", "2019-04-08 08:40:26.830127"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.839543"], ["updated_at", "2019-04-08 08:40:26.839543"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.851200"], ["updated_at", "2019-04-08 08:40:26.851200"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:26.861823"], ["updated_at", "2019-04-08 08:40:26.861823"], ["synced_id", 123], ["host", "test.example"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.871777"], ["updated_at", "2019-04-08 08:40:26.871777"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:26.902151"], ["updated_at", "2019-04-08 08:40:26.902151"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:26.908553"], ["updated_at", "2019-04-08 08:40:26.908553"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:26.913925"], ["updated_at", "2019-04-08 08:40:26.913925"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:26.920271"], ["updated_at", "2019-04-08 08:40:26.920271"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:26.930511"], ["updated_at", "2019-04-08 08:40:26.930511"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:40:26.965481"], ["updated_at", "2019-04-08 08:40:26.965481"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.004021"], ["updated_at", "2019-04-08 08:40:27.004021"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:40:27.061032"], ["updated_at", "2019-04-08 08:40:27.061032"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 9.1ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:40:27.072992"], ["updated_at", "2019-04-08 08:40:27.072992"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.9ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:40:27.085912"], ["updated_at", "2019-04-08 08:40:27.085912"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:40:27.105611"], ["updated_at", "2019-04-08 08:40:27.105611"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.7ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.120039"], ["updated_at", "2019-04-08 08:40:27.120039"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.124846"], ["updated_at", "2019-04-08 08:40:27.124846"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:40:27.134630"], ["updated_at", "2019-04-08 08:40:27.134630"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.151775"], ["updated_at", "2019-04-08 08:40:27.151775"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.169035"], ["updated_at", "2019-04-08 08:40:27.169035"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.194388"], ["updated_at", "2019-04-08 08:40:27.194388"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.208085"], ["updated_at", "2019-04-08 08:40:27.208085"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.228182"], ["updated_at", "2019-04-08 08:40:27.228182"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.242650"], ["updated_at", "2019-04-08 08:40:27.242650"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:40:27.262225"], ["updated_at", "2019-04-08 08:40:27.262225"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 185], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:40:27.266906"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 185]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 185], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:40:27.278525"], ["updated_at", "2019-04-08 08:40:27.278525"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799227"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:40:27.288489"], ["updated_at", "2019-04-08 08:40:27.288489"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626427"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 187], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:40:27.294042"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885627"], ["id", 187]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 187]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:40:27.310403"], ["updated_at", "2019-04-08 08:40:27.310403"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:40:27.320114"], ["updated_at", "2019-04-08 08:40:27.320114"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.355109"], ["updated_at", "2019-04-08 08:40:27.355109"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.359483"], ["updated_at", "2019-04-08 08:40:27.359483"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 191], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:40:27.365031"], ["id", 191]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.371258"], ["updated_at", "2019-04-08 08:40:27.371258"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.374713"], ["updated_at", "2019-04-08 08:40:27.374713"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 193], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:40:27.378900"], ["id", 193]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 193], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.385688"], ["updated_at", "2019-04-08 08:40:27.385688"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.389046"], ["updated_at", "2019-04-08 08:40:27.389046"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 195], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:40:27.393416"], ["id", 195]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 195], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.401065"], ["updated_at", "2019-04-08 08:40:27.401065"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.410823"], ["updated_at", "2019-04-08 08:40:27.410823"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 197], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:40:27.421118"], ["id", 197]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.429698"], ["updated_at", "2019-04-08 08:40:27.429698"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:40:27.437559"], ["updated_at", "2019-04-08 08:40:27.437559"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.447008"], ["updated_at", "2019-04-08 08:40:27.447008"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:40:27.454536"], ["updated_at", "2019-04-08 08:40:27.454536"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.463826"], ["updated_at", "2019-04-08 08:40:27.463826"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:40:27.471701"], ["updated_at", "2019-04-08 08:40:27.471701"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:40:27.479442"], ["updated_at", "2019-04-08 08:40:27.479442"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:40:27.485329"], ["updated_at", "2019-04-08 08:40:27.485329"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:40:27.492316"], ["updated_at", "2019-04-08 08:40:27.492316"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:40:27.497348"], ["updated_at", "2019-04-08 08:40:27.497348"], ["synced_id", 2]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:40:27.501383"], ["updated_at", "2019-04-08 08:40:27.501383"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:40:27.514755"], ["updated_at", "2019-04-08 08:40:27.514755"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:40:27.518597"], ["synced_id", 0], ["id", 209]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:40:27.531954"], ["updated_at", "2019-04-08 08:40:27.531954"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:40:27.540219"], ["updated_at", "2019-04-08 08:40:27.540219"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.4ms) BEGIN  (2.4ms) ROLLBACK  (0.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:42:05.110141"], ["updated_at", "2019-04-08 08:42:05.110141"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.141981"], ["updated_at", "2019-04-08 08:42:05.141981"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.148340"], ["updated_at", "2019-04-08 08:42:05.148340"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:42:05.222269"], ["updated_at", "2019-04-08 08:42:05.222269"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:42:05.248250"], ["updated_at", "2019-04-08 08:42:05.248250"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:42:05.252839"], ["updated_at", "2019-04-08 08:42:05.252839"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:42:05.257053"], ["updated_at", "2019-04-08 08:42:05.257053"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:42:05.269853"], ["updated_at", "2019-04-08 08:42:05.269853"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:42:05.273538"], ["synced_id", 0], ["id", 216]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.0ms) BEGIN  (3.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.300520"], ["updated_at", "2019-04-08 08:42:05.300520"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 217], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:42:05.307467"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 217]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 217], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) ROLLBACK  (1.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:42:05.332313"], ["updated_at", "2019-04-08 08:42:05.332313"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:42:05.342553"], ["updated_at", "2019-04-08 08:42:05.342553"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:42:05.358207"], ["updated_at", "2019-04-08 08:42:05.358207"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799325"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:42:05.375325"], ["updated_at", "2019-04-08 08:42:05.375325"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626525"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 221], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:42:05.382609"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885725"], ["id", 221]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 221]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.398380"], ["updated_at", "2019-04-08 08:42:05.398380"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.404421"], ["updated_at", "2019-04-08 08:42:05.404421"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 223], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:42:05.414673"], ["id", 223]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 223], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.430705"], ["updated_at", "2019-04-08 08:42:05.430705"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.436873"], ["updated_at", "2019-04-08 08:42:05.436873"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 225], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:42:05.445149"], ["id", 225]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 225], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.457693"], ["updated_at", "2019-04-08 08:42:05.457693"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.465870"], ["updated_at", "2019-04-08 08:42:05.465870"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 227], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:42:05.477799"], ["id", 227]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.487925"], ["updated_at", "2019-04-08 08:42:05.487925"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.493848"], ["updated_at", "2019-04-08 08:42:05.493848"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 229], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:42:05.502068"], ["id", 229]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.515103"], ["updated_at", "2019-04-08 08:42:05.515103"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:42:05.531112"], ["updated_at", "2019-04-08 08:42:05.531112"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "accounts"  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.543112"], ["updated_at", "2019-04-08 08:42:05.543112"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:42:05.550810"], ["updated_at", "2019-04-08 08:42:05.550810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.561889"], ["updated_at", "2019-04-08 08:42:05.561889"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:42:05.569046"], ["updated_at", "2019-04-08 08:42:05.569046"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.579876"], ["updated_at", "2019-04-08 08:42:05.579876"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:42:05.587454"], ["updated_at", "2019-04-08 08:42:05.587454"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:42:05.598608"], ["updated_at", "2019-04-08 08:42:05.598608"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.614320"], ["updated_at", "2019-04-08 08:42:05.614320"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.646176"], ["updated_at", "2019-04-08 08:42:05.646176"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.666531"], ["updated_at", "2019-04-08 08:42:05.666531"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.700057"], ["updated_at", "2019-04-08 08:42:05.700057"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.716224"], ["updated_at", "2019-04-08 08:42:05.716224"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.731071"], ["updated_at", "2019-04-08 08:42:05.731071"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:42:05.751467"], ["updated_at", "2019-04-08 08:42:05.751467"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.7ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:42:05.761270"], ["updated_at", "2019-04-08 08:42:05.761270"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.3ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:42:05.774936"], ["updated_at", "2019-04-08 08:42:05.774936"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.7ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:42:05.791636"], ["updated_at", "2019-04-08 08:42:05.791636"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.7ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.842661"], ["updated_at", "2019-04-08 08:42:05.842661"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:42:05.868005"], ["updated_at", "2019-04-08 08:42:05.868005"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.879214"], ["updated_at", "2019-04-08 08:42:05.879214"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.887144"], ["updated_at", "2019-04-08 08:42:05.887144"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.899459"], ["updated_at", "2019-04-08 08:42:05.899459"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.904576"], ["updated_at", "2019-04-08 08:42:05.904576"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.909146"], ["updated_at", "2019-04-08 08:42:05.909146"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.914149"], ["updated_at", "2019-04-08 08:42:05.914149"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:05.922835"], ["updated_at", "2019-04-08 08:42:05.922835"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.930432"], ["updated_at", "2019-04-08 08:42:05.930432"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.938431"], ["updated_at", "2019-04-08 08:42:05.938431"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.951058"], ["updated_at", "2019-04-08 08:42:05.951058"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.956563"], ["updated_at", "2019-04-08 08:42:05.956563"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:42:05.964827"], ["updated_at", "2019-04-08 08:42:05.964827"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:42:05.975524"], ["updated_at", "2019-04-08 08:42:05.975524"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.980086"], ["updated_at", "2019-04-08 08:42:05.980086"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:42:05.989144"], ["updated_at", "2019-04-08 08:42:05.989144"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:05.993708"], ["updated_at", "2019-04-08 08:42:05.993708"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:42:06.003081"], ["updated_at", "2019-04-08 08:42:06.003081"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.007616"], ["updated_at", "2019-04-08 08:42:06.007616"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.015384"], ["updated_at", "2019-04-08 08:42:06.015384"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.020421"], ["updated_at", "2019-04-08 08:42:06.020421"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 253], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:42:06.026415"], ["id", 253]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.034947"], ["updated_at", "2019-04-08 08:42:06.034947"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.039694"], ["updated_at", "2019-04-08 08:42:06.039694"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 255], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:42:06.046190"], ["id", 255]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 255], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.057428"], ["updated_at", "2019-04-08 08:42:06.057428"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.063470"], ["updated_at", "2019-04-08 08:42:06.063470"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 257], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:42:06.070110"], ["id", 257]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 257], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.079846"], ["updated_at", "2019-04-08 08:42:06.079846"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.084874"], ["updated_at", "2019-04-08 08:42:06.084874"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:42:06.102380"], ["updated_at", "2019-04-08 08:42:06.102380"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626526"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 261], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:42:06.108143"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885726"], ["id", 261]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 261]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:42:06.119504"], ["updated_at", "2019-04-08 08:42:06.119504"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799326"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:42:06.127356"], ["updated_at", "2019-04-08 08:42:06.127356"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 263], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:42:06.132638"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 263]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 263], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:42:06.141381"], ["updated_at", "2019-04-08 08:42:06.141381"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.148908"], ["updated_at", "2019-04-08 08:42:06.148908"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:42:06.160104"], ["updated_at", "2019-04-08 08:42:06.160104"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:49.794201"], ["updated_at", "2019-04-08 08:44:49.794201"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:49.888717"], ["updated_at", "2019-04-08 08:44:49.888717"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 241], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:44:49.894360"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 241]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 241], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:44:49.925366"], ["updated_at", "2019-04-08 08:44:49.925366"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:44:49.935989"], ["updated_at", "2019-04-08 08:44:49.935989"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:44:49.940469"], ["updated_at", "2019-04-08 08:44:49.940469"], ["synced_id", 2]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:44:49.945788"], ["updated_at", "2019-04-08 08:44:49.945788"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:44:49.957014"], ["updated_at", "2019-04-08 08:44:49.957014"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799489"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:44:49.967402"], ["updated_at", "2019-04-08 08:44:49.967402"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626689"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 246], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:44:49.972915"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885889"], ["id", 246]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 246]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:44:49.998010"], ["updated_at", "2019-04-08 08:44:49.998010"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:44:50.011695"], ["updated_at", "2019-04-08 08:44:50.011695"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:44:50.016433"], ["synced_id", 0], ["id", 248]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:44:50.037670"], ["updated_at", "2019-04-08 08:44:50.037670"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.046477"], ["updated_at", "2019-04-08 08:44:50.046477"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.051857"], ["updated_at", "2019-04-08 08:44:50.051857"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 251], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:44:50.062664"], ["id", 251]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 251], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.075308"], ["updated_at", "2019-04-08 08:44:50.075308"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.088491"], ["updated_at", "2019-04-08 08:44:50.088491"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 253], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:44:50.097384"], ["id", 253]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 253], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.107755"], ["updated_at", "2019-04-08 08:44:50.107755"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.112460"], ["updated_at", "2019-04-08 08:44:50.112460"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 255], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:44:50.118489"], ["id", 255]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.125305"], ["updated_at", "2019-04-08 08:44:50.125305"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.129974"], ["updated_at", "2019-04-08 08:44:50.129974"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 257], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:44:50.137969"], ["id", 257]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.151722"], ["updated_at", "2019-04-08 08:44:50.151722"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:44:50.163811"], ["updated_at", "2019-04-08 08:44:50.163811"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.174054"], ["updated_at", "2019-04-08 08:44:50.174054"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:44:50.180438"], ["updated_at", "2019-04-08 08:44:50.180438"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.187994"], ["updated_at", "2019-04-08 08:44:50.187994"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:44:50.193172"], ["updated_at", "2019-04-08 08:44:50.193172"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.200419"], ["updated_at", "2019-04-08 08:44:50.200419"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:44:50.205226"], ["updated_at", "2019-04-08 08:44:50.205226"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:44:50.212454"], ["updated_at", "2019-04-08 08:44:50.212454"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:44:50.282977"], ["updated_at", "2019-04-08 08:44:50.282977"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:44:50.296347"], ["updated_at", "2019-04-08 08:44:50.296347"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.4ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:44:50.312682"], ["updated_at", "2019-04-08 08:44:50.312682"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 4.2ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:44:50.330209"], ["updated_at", "2019-04-08 08:44:50.330209"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.4ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.339997"], ["updated_at", "2019-04-08 08:44:50.339997"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.343770"], ["updated_at", "2019-04-08 08:44:50.343770"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.348610"], ["updated_at", "2019-04-08 08:44:50.348610"], ["synced_id", 1], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.358226"], ["updated_at", "2019-04-08 08:44:50.358226"], ["synced_id", 2], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.375531"], ["updated_at", "2019-04-08 08:44:50.375531"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.384135"], ["updated_at", "2019-04-08 08:44:50.384135"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.390648"], ["updated_at", "2019-04-08 08:44:50.390648"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:44:50.405748"], ["updated_at", "2019-04-08 08:44:50.405748"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626690"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 272], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:44:50.411299"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885890"], ["id", 272]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 272]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:44:50.421623"], ["updated_at", "2019-04-08 08:44:50.421623"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799490"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.428786"], ["updated_at", "2019-04-08 08:44:50.428786"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.436125"], ["updated_at", "2019-04-08 08:44:50.436125"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:44:50.445593"], ["updated_at", "2019-04-08 08:44:50.445593"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 275], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:44:50.450989"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 275]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 275], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.469634"], ["updated_at", "2019-04-08 08:44:50.469634"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:44:50.491550"], ["updated_at", "2019-04-08 08:44:50.491550"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.502048"], ["updated_at", "2019-04-08 08:44:50.502048"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.507164"], ["updated_at", "2019-04-08 08:44:50.507164"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:44:50.514909"], ["updated_at", "2019-04-08 08:44:50.514909"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:44:50.525918"], ["updated_at", "2019-04-08 08:44:50.525918"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.530375"], ["updated_at", "2019-04-08 08:44:50.530375"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:44:50.538945"], ["updated_at", "2019-04-08 08:44:50.538945"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.543744"], ["updated_at", "2019-04-08 08:44:50.543744"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:44:50.551672"], ["updated_at", "2019-04-08 08:44:50.551672"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.555527"], ["updated_at", "2019-04-08 08:44:50.555527"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.563004"], ["updated_at", "2019-04-08 08:44:50.563004"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.567395"], ["updated_at", "2019-04-08 08:44:50.567395"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 287], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:44:50.573093"], ["id", 287]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.581660"], ["updated_at", "2019-04-08 08:44:50.581660"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.585924"], ["updated_at", "2019-04-08 08:44:50.585924"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 289], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:44:50.590851"], ["id", 289]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 289], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.599394"], ["updated_at", "2019-04-08 08:44:50.599394"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.603678"], ["updated_at", "2019-04-08 08:44:50.603678"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 291], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:44:50.609448"], ["id", 291]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 291], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.618172"], ["updated_at", "2019-04-08 08:44:50.618172"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.621981"], ["updated_at", "2019-04-08 08:44:50.621981"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.633850"], ["updated_at", "2019-04-08 08:44:50.633850"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.641674"], ["updated_at", "2019-04-08 08:44:50.641674"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.655915"], ["updated_at", "2019-04-08 08:44:50.655915"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.675669"], ["updated_at", "2019-04-08 08:44:50.675669"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.699316"], ["updated_at", "2019-04-08 08:44:50.699316"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.720484"], ["updated_at", "2019-04-08 08:44:50.720484"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.736190"], ["updated_at", "2019-04-08 08:44:50.736190"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:44:50.755527"], ["updated_at", "2019-04-08 08:44:50.755527"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:44:50.771558"], ["updated_at", "2019-04-08 08:44:50.771558"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.780465"], ["updated_at", "2019-04-08 08:44:50.780465"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:44:50.784933"], ["updated_at", "2019-04-08 08:44:50.784933"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 10ms (Views: 7.6ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:45:28.141985"], ["updated_at", "2019-04-08 08:45:28.141985"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 49ms (ActiveRecord: 15.7ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:45:28.156409"], ["updated_at", "2019-04-08 08:45:28.156409"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:45:28.174536"], ["updated_at", "2019-04-08 08:45:28.174536"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.6ms)  (1.2ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:45:28.215066"], ["updated_at", "2019-04-08 08:45:28.215066"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 7.8ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.287317"], ["updated_at", "2019-04-08 08:45:28.287317"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.330445"], ["updated_at", "2019-04-08 08:45:28.330445"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.351301"], ["updated_at", "2019-04-08 08:45:28.351301"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.376695"], ["updated_at", "2019-04-08 08:45:28.376695"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.402902"], ["updated_at", "2019-04-08 08:45:28.402902"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.418496"], ["updated_at", "2019-04-08 08:45:28.418496"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:45:28.447669"], ["updated_at", "2019-04-08 08:45:28.447669"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:45:28.454885"], ["updated_at", "2019-04-08 08:45:28.454885"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:45:28.464579"], ["updated_at", "2019-04-08 08:45:28.464579"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799528"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:45:28.472119"], ["updated_at", "2019-04-08 08:45:28.472119"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626728"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 276], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:45:28.477175"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885928"], ["id", 276]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 276]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:45:28.488359"], ["updated_at", "2019-04-08 08:45:28.488359"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:45:28.492670"], ["updated_at", "2019-04-08 08:45:28.492670"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:45:28.496629"], ["updated_at", "2019-04-08 08:45:28.496629"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:45:28.510670"], ["updated_at", "2019-04-08 08:45:28.510670"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:45:28.515631"], ["synced_id", 0], ["id", 280]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:45:28.528545"], ["updated_at", "2019-04-08 08:45:28.528545"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.537696"], ["updated_at", "2019-04-08 08:45:28.537696"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 282], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:45:28.543157"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 282]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 282], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:45:28.554965"], ["updated_at", "2019-04-08 08:45:28.554965"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.570858"], ["updated_at", "2019-04-08 08:45:28.570858"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:45:28.580046"], ["updated_at", "2019-04-08 08:45:28.580046"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.588770"], ["updated_at", "2019-04-08 08:45:28.588770"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:45:28.593526"], ["updated_at", "2019-04-08 08:45:28.593526"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.599434"], ["updated_at", "2019-04-08 08:45:28.599434"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:45:28.603702"], ["updated_at", "2019-04-08 08:45:28.603702"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.609717"], ["updated_at", "2019-04-08 08:45:28.609717"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:45:28.614390"], ["updated_at", "2019-04-08 08:45:28.614390"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.620622"], ["updated_at", "2019-04-08 08:45:28.620622"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.625115"], ["updated_at", "2019-04-08 08:45:28.625115"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 293], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:45:28.631489"], ["id", 293]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 293], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.644925"], ["updated_at", "2019-04-08 08:45:28.644925"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.650686"], ["updated_at", "2019-04-08 08:45:28.650686"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 295], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:45:28.656731"], ["id", 295]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 295], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.665162"], ["updated_at", "2019-04-08 08:45:28.665162"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.669516"], ["updated_at", "2019-04-08 08:45:28.669516"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 297], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:45:28.675954"], ["id", 297]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.683454"], ["updated_at", "2019-04-08 08:45:28.683454"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.687337"], ["updated_at", "2019-04-08 08:45:28.687337"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 299], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:45:28.692316"], ["id", 299]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:45:28.713970"], ["updated_at", "2019-04-08 08:45:28.713970"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.727043"], ["updated_at", "2019-04-08 08:45:28.727043"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.732732"], ["updated_at", "2019-04-08 08:45:28.732732"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.788173"], ["updated_at", "2019-04-08 08:45:28.788173"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.801195"], ["updated_at", "2019-04-08 08:45:28.801195"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.806080"], ["updated_at", "2019-04-08 08:45:28.806080"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:45:28.813655"], ["updated_at", "2019-04-08 08:45:28.813655"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:45:28.824786"], ["updated_at", "2019-04-08 08:45:28.824786"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.829319"], ["updated_at", "2019-04-08 08:45:28.829319"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:45:28.840169"], ["updated_at", "2019-04-08 08:45:28.840169"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.844475"], ["updated_at", "2019-04-08 08:45:28.844475"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:45:28.854854"], ["updated_at", "2019-04-08 08:45:28.854854"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.859449"], ["updated_at", "2019-04-08 08:45:28.859449"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.868785"], ["updated_at", "2019-04-08 08:45:28.868785"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.873429"], ["updated_at", "2019-04-08 08:45:28.873429"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 311], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:45:28.880599"], ["id", 311]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.890290"], ["updated_at", "2019-04-08 08:45:28.890290"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.899946"], ["updated_at", "2019-04-08 08:45:28.899946"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 313], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:45:28.913209"], ["id", 313]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 313], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.926948"], ["updated_at", "2019-04-08 08:45:28.926948"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.932017"], ["updated_at", "2019-04-08 08:45:28.932017"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 315], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:45:28.937228"], ["id", 315]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 315], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.948645"], ["updated_at", "2019-04-08 08:45:28.948645"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.954092"], ["updated_at", "2019-04-08 08:45:28.954092"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:45:28.974775"], ["updated_at", "2019-04-08 08:45:28.974775"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 319], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:45:28.979091"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 319]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 319], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:28.987467"], ["updated_at", "2019-04-08 08:45:28.987467"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:28.993963"], ["updated_at", "2019-04-08 08:45:28.993963"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:29.001517"], ["updated_at", "2019-04-08 08:45:29.001517"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:29.010406"], ["updated_at", "2019-04-08 08:45:29.010406"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:29.018388"], ["updated_at", "2019-04-08 08:45:29.018388"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:29.029823"], ["updated_at", "2019-04-08 08:45:29.029823"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:29.038867"], ["updated_at", "2019-04-08 08:45:29.038867"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:45:29.050565"], ["updated_at", "2019-04-08 08:45:29.050565"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:29.058760"], ["updated_at", "2019-04-08 08:45:29.058760"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:29.063873"], ["updated_at", "2019-04-08 08:45:29.063873"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:29.069090"], ["updated_at", "2019-04-08 08:45:29.069090"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:45:29.073486"], ["updated_at", "2019-04-08 08:45:29.073486"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:45:29.083576"], ["updated_at", "2019-04-08 08:45:29.083576"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626729"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 328], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:45:29.089364"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885929"], ["id", 328]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 328]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:45:29.100771"], ["updated_at", "2019-04-08 08:45:29.100771"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799529"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:45:29.107826"], ["updated_at", "2019-04-08 08:45:29.107826"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.117860"], ["updated_at", "2019-04-08 08:46:29.117860"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.154421"], ["updated_at", "2019-04-08 08:46:29.154421"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.168637"], ["updated_at", "2019-04-08 08:46:29.168637"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.181334"], ["updated_at", "2019-04-08 08:46:29.181334"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.202644"], ["updated_at", "2019-04-08 08:46:29.202644"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.219361"], ["updated_at", "2019-04-08 08:46:29.219361"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.257399"], ["updated_at", "2019-04-08 08:46:29.257399"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:46:29.275267"], ["updated_at", "2019-04-08 08:46:29.275267"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799589"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:46:29.295286"], ["updated_at", "2019-04-08 08:46:29.295286"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626789"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 333], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:29.301959"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885989"], ["id", 333]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 333]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:29.317864"], ["updated_at", "2019-04-08 08:46:29.317864"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 334], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:29.322870"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 334]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 334], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.331910"], ["updated_at", "2019-04-08 08:46:29.331910"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.346060"], ["updated_at", "2019-04-08 08:46:29.346060"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.360121"], ["updated_at", "2019-04-08 08:46:29.360121"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.364272"], ["updated_at", "2019-04-08 08:46:29.364272"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.368135"], ["updated_at", "2019-04-08 08:46:29.368135"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.371987"], ["updated_at", "2019-04-08 08:46:29.371987"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.391030"], ["updated_at", "2019-04-08 08:46:29.391030"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.400646"], ["updated_at", "2019-04-08 08:46:29.400646"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.418060"], ["updated_at", "2019-04-08 08:46:29.418060"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.423417"], ["updated_at", "2019-04-08 08:46:29.423417"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.437002"], ["updated_at", "2019-04-08 08:46:29.437002"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.442508"], ["updated_at", "2019-04-08 08:46:29.442508"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 343], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:29.456238"], ["id", 343]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.467977"], ["updated_at", "2019-04-08 08:46:29.467977"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.476256"], ["updated_at", "2019-04-08 08:46:29.476256"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 345], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (3.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:29.490234"], ["id", 345]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 345], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.508690"], ["updated_at", "2019-04-08 08:46:29.508690"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (3.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.522187"], ["updated_at", "2019-04-08 08:46:29.522187"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 347], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:29.540640"], ["id", 347]]  (1.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 347], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (2.8ms) BEGIN  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.563615"], ["updated_at", "2019-04-08 08:46:29.563615"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.578916"], ["updated_at", "2019-04-08 08:46:29.578916"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:29.600979"], ["updated_at", "2019-04-08 08:46:29.600979"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:29.614306"], ["updated_at", "2019-04-08 08:46:29.614306"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.619747"], ["updated_at", "2019-04-08 08:46:29.619747"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:29.631996"], ["updated_at", "2019-04-08 08:46:29.631996"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.639031"], ["updated_at", "2019-04-08 08:46:29.639031"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (3.0ms) RELEASE SAVEPOINT active_record_1  (2.8ms) ROLLBACK  (1.3ms) BEGIN MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:29.662385"], ["updated_at", "2019-04-08 08:46:29.662385"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.668630"], ["updated_at", "2019-04-08 08:46:29.668630"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:29.678584"], ["updated_at", "2019-04-08 08:46:29.678584"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.689024"], ["updated_at", "2019-04-08 08:46:29.689024"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.696848"], ["updated_at", "2019-04-08 08:46:29.696848"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.705953"], ["updated_at", "2019-04-08 08:46:29.705953"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.729172"], ["updated_at", "2019-04-08 08:46:29.729172"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.735147"], ["updated_at", "2019-04-08 08:46:29.735147"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:29.758597"], ["updated_at", "2019-04-08 08:46:29.758597"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:29.774440"], ["updated_at", "2019-04-08 08:46:29.774440"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:29.788753"], ["updated_at", "2019-04-08 08:46:29.788753"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:29.803530"], ["updated_at", "2019-04-08 08:46:29.803530"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.6ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:29.821561"], ["updated_at", "2019-04-08 08:46:29.821561"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 10ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:29.867692"], ["updated_at", "2019-04-08 08:46:29.867692"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:46:29.881413"], ["updated_at", "2019-04-08 08:46:29.881413"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:46:29.885880"], ["synced_id", 0], ["id", 305]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.899435"], ["updated_at", "2019-04-08 08:46:29.899435"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:29.908376"], ["updated_at", "2019-04-08 08:46:29.908376"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.917347"], ["updated_at", "2019-04-08 08:46:29.917347"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:29.922719"], ["updated_at", "2019-04-08 08:46:29.922719"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.929339"], ["updated_at", "2019-04-08 08:46:29.929339"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:29.934509"], ["updated_at", "2019-04-08 08:46:29.934509"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.941555"], ["updated_at", "2019-04-08 08:46:29.941555"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:29.947206"], ["updated_at", "2019-04-08 08:46:29.947206"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.954676"], ["updated_at", "2019-04-08 08:46:29.954676"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.958508"], ["updated_at", "2019-04-08 08:46:29.958508"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 315], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:29.964700"], ["id", 315]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.971965"], ["updated_at", "2019-04-08 08:46:29.971965"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.975964"], ["updated_at", "2019-04-08 08:46:29.975964"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 317], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:29.981992"], ["id", 317]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 317], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.990359"], ["updated_at", "2019-04-08 08:46:29.990359"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:29.993920"], ["updated_at", "2019-04-08 08:46:29.993920"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 319], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:30.000549"], ["id", 319]]  (3.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 319], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:30.017125"], ["updated_at", "2019-04-08 08:46:30.017125"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:30.025591"], ["updated_at", "2019-04-08 08:46:30.025591"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 321], ["LIMIT", 1]] Account Update (1.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:30.034770"], ["id", 321]]  (3.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:30.051753"], ["updated_at", "2019-04-08 08:46:30.051753"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (3.8ms) ROLLBACK  (2.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:30.085020"], ["updated_at", "2019-04-08 08:46:30.085020"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:30.094481"], ["updated_at", "2019-04-08 08:46:30.094481"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626790"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 324], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:30.099879"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554885990"], ["id", 324]]  (2.7ms) RELEASE SAVEPOINT active_record_1 Account Load (2.1ms) SELECT "accounts".* FROM "accounts"  (1.1ms) SAVEPOINT active_record_1 Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 324]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:30.118988"], ["updated_at", "2019-04-08 08:46:30.118988"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799590"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:30.131075"], ["updated_at", "2019-04-08 08:46:30.131075"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (3.5ms) ROLLBACK  (2.1ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:30.155404"], ["updated_at", "2019-04-08 08:46:30.155404"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 327], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:30.162272"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 327]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 327], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:30.179862"], ["updated_at", "2019-04-08 08:46:30.179862"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (3.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:30.195628"], ["updated_at", "2019-04-08 08:46:30.195628"], ["synced_id", 1]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 Account Exists (4.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:30.214346"], ["updated_at", "2019-04-08 08:46:30.214346"], ["synced_id", 2]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:30.225648"], ["updated_at", "2019-04-08 08:46:30.225648"], ["synced_id", 3]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) ROLLBACK  (2.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:56.555408"], ["updated_at", "2019-04-08 08:46:56.555408"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:56.641016"], ["updated_at", "2019-04-08 08:46:56.641016"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 35ms (ActiveRecord: 9.7ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:56.660142"], ["updated_at", "2019-04-08 08:46:56.660142"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:56.675824"], ["updated_at", "2019-04-08 08:46:56.675824"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.6ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:56.706625"], ["updated_at", "2019-04-08 08:46:56.706625"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 7.2ms)  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 12ms (Views: 7.4ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.742535"], ["updated_at", "2019-04-08 08:46:56.742535"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.747559"], ["updated_at", "2019-04-08 08:46:56.747559"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:56.759858"], ["updated_at", "2019-04-08 08:46:56.759858"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:56.786194"], ["updated_at", "2019-04-08 08:46:56.786194"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 335], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:56.790882"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 335]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 335], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:56.811704"], ["updated_at", "2019-04-08 08:46:56.811704"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.819482"], ["updated_at", "2019-04-08 08:46:56.819482"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:56.826858"], ["updated_at", "2019-04-08 08:46:56.826858"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.836442"], ["updated_at", "2019-04-08 08:46:56.836442"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:56.842837"], ["updated_at", "2019-04-08 08:46:56.842837"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.851223"], ["updated_at", "2019-04-08 08:46:56.851223"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:56.856684"], ["updated_at", "2019-04-08 08:46:56.856684"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.864442"], ["updated_at", "2019-04-08 08:46:56.864442"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:46:56.869249"], ["updated_at", "2019-04-08 08:46:56.869249"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.876009"], ["updated_at", "2019-04-08 08:46:56.876009"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.881558"], ["updated_at", "2019-04-08 08:46:56.881558"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 345], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:56.887949"], ["id", 345]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 345], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.897836"], ["updated_at", "2019-04-08 08:46:56.897836"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.902614"], ["updated_at", "2019-04-08 08:46:56.902614"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 347], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:56.910269"], ["id", 347]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 347], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.920508"], ["updated_at", "2019-04-08 08:46:56.920508"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.924823"], ["updated_at", "2019-04-08 08:46:56.924823"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 349], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:56.930820"], ["id", 349]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.938103"], ["updated_at", "2019-04-08 08:46:56.938103"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:56.942648"], ["updated_at", "2019-04-08 08:46:56.942648"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 351], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:56.948742"], ["id", 351]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:56.955614"], ["updated_at", "2019-04-08 08:46:56.955614"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:56.962912"], ["updated_at", "2019-04-08 08:46:56.962912"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:56.966783"], ["updated_at", "2019-04-08 08:46:56.966783"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:56.971300"], ["updated_at", "2019-04-08 08:46:56.971300"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:56.980438"], ["updated_at", "2019-04-08 08:46:56.980438"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:46:57.010535"], ["updated_at", "2019-04-08 08:46:57.010535"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:57.020077"], ["updated_at", "2019-04-08 08:46:57.020077"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799617"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:57.028645"], ["updated_at", "2019-04-08 08:46:57.028645"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626817"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 359], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:57.033950"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886017"], ["id", 359]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 359]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:46:57.048780"], ["updated_at", "2019-04-08 08:46:57.048780"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:46:57.052830"], ["synced_id", 0], ["id", 360]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:46:57.101306"], ["updated_at", "2019-04-08 08:46:57.101306"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626817"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 368], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:57.107603"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886017"], ["id", 368]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 368]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:46:57.119512"], ["updated_at", "2019-04-08 08:46:57.119512"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799617"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.129041"], ["updated_at", "2019-04-08 08:46:57.129041"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:57.150111"], ["updated_at", "2019-04-08 08:46:57.150111"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 371], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:46:57.159575"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 371]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 371], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:57.175808"], ["updated_at", "2019-04-08 08:46:57.175808"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:57.181157"], ["updated_at", "2019-04-08 08:46:57.181157"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:57.186549"], ["updated_at", "2019-04-08 08:46:57.186549"], ["synced_id", 1], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:57.192463"], ["updated_at", "2019-04-08 08:46:57.192463"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:57.207215"], ["updated_at", "2019-04-08 08:46:57.207215"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.215267"], ["updated_at", "2019-04-08 08:46:57.215267"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.221816"], ["updated_at", "2019-04-08 08:46:57.221816"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.230154"], ["updated_at", "2019-04-08 08:46:57.230154"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.233810"], ["updated_at", "2019-04-08 08:46:57.233810"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 377], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:57.239362"], ["id", 377]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.246318"], ["updated_at", "2019-04-08 08:46:57.246318"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.250113"], ["updated_at", "2019-04-08 08:46:57.250113"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 379], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:57.256506"], ["id", 379]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 379], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.264872"], ["updated_at", "2019-04-08 08:46:57.264872"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.271686"], ["updated_at", "2019-04-08 08:46:57.271686"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 381], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:46:57.280870"], ["id", 381]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 381], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.293204"], ["updated_at", "2019-04-08 08:46:57.293204"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.298902"], ["updated_at", "2019-04-08 08:46:57.298902"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:57.306367"], ["updated_at", "2019-04-08 08:46:57.306367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:57.318302"], ["updated_at", "2019-04-08 08:46:57.318302"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.324852"], ["updated_at", "2019-04-08 08:46:57.324852"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:57.333962"], ["updated_at", "2019-04-08 08:46:57.333962"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.339105"], ["updated_at", "2019-04-08 08:46:57.339105"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:46:57.348320"], ["updated_at", "2019-04-08 08:46:57.348320"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.353084"], ["updated_at", "2019-04-08 08:46:57.353084"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.361074"], ["updated_at", "2019-04-08 08:46:57.361074"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.365114"], ["updated_at", "2019-04-08 08:46:57.365114"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:46:57.377695"], ["updated_at", "2019-04-08 08:46:57.377695"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:57.385500"], ["updated_at", "2019-04-08 08:46:57.385500"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.393380"], ["updated_at", "2019-04-08 08:46:57.393380"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:46:57.402927"], ["updated_at", "2019-04-08 08:46:57.402927"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.412799"], ["updated_at", "2019-04-08 08:46:57.412799"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.425485"], ["updated_at", "2019-04-08 08:46:57.425485"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.442896"], ["updated_at", "2019-04-08 08:46:57.442896"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.464509"], ["updated_at", "2019-04-08 08:46:57.464509"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.495256"], ["updated_at", "2019-04-08 08:46:57.495256"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.517536"], ["updated_at", "2019-04-08 08:46:57.517536"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:46:57.533569"], ["updated_at", "2019-04-08 08:46:57.533569"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 7ms (Views: 7.1ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.467480"], ["updated_at", "2019-04-08 08:47:56.467480"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.489993"], ["updated_at", "2019-04-08 08:47:56.489993"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.527171"], ["updated_at", "2019-04-08 08:47:56.527171"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.548905"], ["updated_at", "2019-04-08 08:47:56.548905"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.565496"], ["updated_at", "2019-04-08 08:47:56.565496"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.588517"], ["updated_at", "2019-04-08 08:47:56.588517"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:47:56.619340"], ["updated_at", "2019-04-08 08:47:56.619340"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626876"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 397], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:47:56.633209"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886076"], ["id", 397]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 397]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:47:56.648373"], ["updated_at", "2019-04-08 08:47:56.648373"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799676"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:56.671929"], ["updated_at", "2019-04-08 08:47:56.671929"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.679146"], ["updated_at", "2019-04-08 08:47:56.679146"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:47:56.689812"], ["updated_at", "2019-04-08 08:47:56.689812"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 400], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:47:56.694426"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 400]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 400], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:56.704395"], ["updated_at", "2019-04-08 08:47:56.704395"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:56.708882"], ["updated_at", "2019-04-08 08:47:56.708882"], ["synced_id", 2], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:56.715468"], ["updated_at", "2019-04-08 08:47:56.715468"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:56.720115"], ["updated_at", "2019-04-08 08:47:56.720115"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.728904"], ["updated_at", "2019-04-08 08:47:56.728904"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.733244"], ["updated_at", "2019-04-08 08:47:56.733244"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.741714"], ["updated_at", "2019-04-08 08:47:56.741714"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.746887"], ["updated_at", "2019-04-08 08:47:56.746887"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:47:56.756448"], ["updated_at", "2019-04-08 08:47:56.756448"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:47:56.766645"], ["updated_at", "2019-04-08 08:47:56.766645"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.771008"], ["updated_at", "2019-04-08 08:47:56.771008"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:47:56.780946"], ["updated_at", "2019-04-08 08:47:56.780946"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.785368"], ["updated_at", "2019-04-08 08:47:56.785368"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:47:56.793911"], ["updated_at", "2019-04-08 08:47:56.793911"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.798182"], ["updated_at", "2019-04-08 08:47:56.798182"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.805793"], ["updated_at", "2019-04-08 08:47:56.805793"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.809784"], ["updated_at", "2019-04-08 08:47:56.809784"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 416], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:47:56.815930"], ["id", 416]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.824141"], ["updated_at", "2019-04-08 08:47:56.824141"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.828165"], ["updated_at", "2019-04-08 08:47:56.828165"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 418], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:47:56.835664"], ["id", 418]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 418], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.845229"], ["updated_at", "2019-04-08 08:47:56.845229"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.852167"], ["updated_at", "2019-04-08 08:47:56.852167"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 420], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:47:56.862589"], ["id", 420]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 420], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:47:56.878820"], ["updated_at", "2019-04-08 08:47:56.878820"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:56.890641"], ["updated_at", "2019-04-08 08:47:56.890641"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.899804"], ["updated_at", "2019-04-08 08:47:56.899804"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.907612"], ["updated_at", "2019-04-08 08:47:56.907612"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:56.916922"], ["updated_at", "2019-04-08 08:47:56.916922"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.924270"], ["updated_at", "2019-04-08 08:47:56.924270"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.933366"], ["updated_at", "2019-04-08 08:47:56.933366"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:56.958317"], ["updated_at", "2019-04-08 08:47:56.958317"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.014840"], ["updated_at", "2019-04-08 08:47:57.014840"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.020577"], ["updated_at", "2019-04-08 08:47:57.020577"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:47:57.054934"], ["updated_at", "2019-04-08 08:47:57.054934"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:47:57.094065"], ["updated_at", "2019-04-08 08:47:57.094065"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.107211"], ["updated_at", "2019-04-08 08:47:57.107211"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:47:57.114830"], ["updated_at", "2019-04-08 08:47:57.114830"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.123800"], ["updated_at", "2019-04-08 08:47:57.123800"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:47:57.129859"], ["updated_at", "2019-04-08 08:47:57.129859"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.137469"], ["updated_at", "2019-04-08 08:47:57.137469"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:47:57.142500"], ["updated_at", "2019-04-08 08:47:57.142500"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.149279"], ["updated_at", "2019-04-08 08:47:57.149279"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:47:57.155177"], ["updated_at", "2019-04-08 08:47:57.155177"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.161770"], ["updated_at", "2019-04-08 08:47:57.161770"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.166264"], ["updated_at", "2019-04-08 08:47:57.166264"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 372], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:47:57.172638"], ["id", 372]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.180174"], ["updated_at", "2019-04-08 08:47:57.180174"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.184248"], ["updated_at", "2019-04-08 08:47:57.184248"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 374], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:47:57.190297"], ["id", 374]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 374], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.199145"], ["updated_at", "2019-04-08 08:47:57.199145"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.203937"], ["updated_at", "2019-04-08 08:47:57.203937"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 376], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:47:57.210071"], ["id", 376]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 376], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.220014"], ["updated_at", "2019-04-08 08:47:57.220014"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:47:57.223894"], ["updated_at", "2019-04-08 08:47:57.223894"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 378], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:47:57.229629"], ["id", 378]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:47:57.236901"], ["updated_at", "2019-04-08 08:47:57.236901"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 379], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:47:57.240608"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 379]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 379], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:47:57.249365"], ["updated_at", "2019-04-08 08:47:57.249365"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554799677"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:47:57.259068"], ["updated_at", "2019-04-08 08:47:57.259068"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554626877"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 381], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:47:57.263853"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886077"], ["id", 381]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 381]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:47:57.275726"], ["updated_at", "2019-04-08 08:47:57.275726"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:47:57.288976"], ["updated_at", "2019-04-08 08:47:57.288976"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:47:57.293980"], ["synced_id", 0], ["id", 383]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:47:57.309636"], ["updated_at", "2019-04-08 08:47:57.309636"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:47:57.318823"], ["updated_at", "2019-04-08 08:47:57.318823"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:47:57.322915"], ["updated_at", "2019-04-08 08:47:57.322915"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:47:57.326463"], ["updated_at", "2019-04-08 08:47:57.326463"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:47:57.337437"], ["updated_at", "2019-04-08 08:47:57.337437"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:47:57.393856"], ["updated_at", "2019-04-08 08:47:57.393856"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 3.1ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:47:57.403498"], ["updated_at", "2019-04-08 08:47:57.403498"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.3ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:47:57.415345"], ["updated_at", "2019-04-08 08:47:57.415345"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:47:57.437571"], ["updated_at", "2019-04-08 08:47:57.437571"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.2ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:11.292941"], ["updated_at", "2019-04-08 08:57:11.292941"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 44ms (ActiveRecord: 15.7ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:11.311440"], ["updated_at", "2019-04-08 08:57:11.311440"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.4ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:11.347074"], ["updated_at", "2019-04-08 08:57:11.347074"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 7.5ms)  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:11.375224"], ["updated_at", "2019-04-08 08:57:11.375224"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 6.0ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:57:11.475271"], ["updated_at", "2019-04-08 08:57:11.475271"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:57:11.479109"], ["synced_id", 0], ["id", 394]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:11.494969"], ["updated_at", "2019-04-08 08:57:11.494969"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.503031"], ["updated_at", "2019-04-08 08:57:11.503031"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 396], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:11.508096"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 396]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 396], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:11.518934"], ["updated_at", "2019-04-08 08:57:11.518934"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800231"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:11.528914"], ["updated_at", "2019-04-08 08:57:11.528914"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627431"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 398], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:11.534894"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886631"], ["id", 398]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 398]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:11.546489"], ["updated_at", "2019-04-08 08:57:11.546489"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.572717"], ["updated_at", "2019-04-08 08:57:11.572717"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:11.581010"], ["updated_at", "2019-04-08 08:57:11.581010"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.590880"], ["updated_at", "2019-04-08 08:57:11.590880"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:11.597511"], ["updated_at", "2019-04-08 08:57:11.597511"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.603828"], ["updated_at", "2019-04-08 08:57:11.603828"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:11.608675"], ["updated_at", "2019-04-08 08:57:11.608675"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.614669"], ["updated_at", "2019-04-08 08:57:11.614669"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:11.621436"], ["updated_at", "2019-04-08 08:57:11.621436"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.629818"], ["updated_at", "2019-04-08 08:57:11.629818"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.635471"], ["updated_at", "2019-04-08 08:57:11.635471"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 409], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:11.647202"], ["id", 409]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.661623"], ["updated_at", "2019-04-08 08:57:11.661623"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.668501"], ["updated_at", "2019-04-08 08:57:11.668501"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 411], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:11.676173"], ["id", 411]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 411], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.685865"], ["updated_at", "2019-04-08 08:57:11.685865"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.690135"], ["updated_at", "2019-04-08 08:57:11.690135"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 413], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:11.695610"], ["id", 413]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 413], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.705505"], ["updated_at", "2019-04-08 08:57:11.705505"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.709442"], ["updated_at", "2019-04-08 08:57:11.709442"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 415], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:11.714435"], ["id", 415]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:11.727856"], ["updated_at", "2019-04-08 08:57:11.727856"], ["synced_id", 1]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:11.737938"], ["updated_at", "2019-04-08 08:57:11.737938"], ["synced_id", 2]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:11.743435"], ["updated_at", "2019-04-08 08:57:11.743435"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:11.754947"], ["updated_at", "2019-04-08 08:57:11.754947"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:11.763163"], ["updated_at", "2019-04-08 08:57:11.763163"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.779436"], ["updated_at", "2019-04-08 08:57:11.779436"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.785131"], ["updated_at", "2019-04-08 08:57:11.785131"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.796885"], ["updated_at", "2019-04-08 08:57:11.796885"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.802522"], ["updated_at", "2019-04-08 08:57:11.802522"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:11.810121"], ["updated_at", "2019-04-08 08:57:11.810121"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:11.821172"], ["updated_at", "2019-04-08 08:57:11.821172"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.826876"], ["updated_at", "2019-04-08 08:57:11.826876"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:11.842807"], ["updated_at", "2019-04-08 08:57:11.842807"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.848626"], ["updated_at", "2019-04-08 08:57:11.848626"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:11.859468"], ["updated_at", "2019-04-08 08:57:11.859468"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.868306"], ["updated_at", "2019-04-08 08:57:11.868306"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.877361"], ["updated_at", "2019-04-08 08:57:11.877361"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.882374"], ["updated_at", "2019-04-08 08:57:11.882374"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 443], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:11.889967"], ["id", 443]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.899257"], ["updated_at", "2019-04-08 08:57:11.899257"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.904500"], ["updated_at", "2019-04-08 08:57:11.904500"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 445], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:11.912761"], ["id", 445]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 445], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.925895"], ["updated_at", "2019-04-08 08:57:11.925895"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.931699"], ["updated_at", "2019-04-08 08:57:11.931699"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 447], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:11.937994"], ["id", 447]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 447], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:11.948344"], ["updated_at", "2019-04-08 08:57:11.948344"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:11.965766"], ["updated_at", "2019-04-08 08:57:11.965766"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.972454"], ["updated_at", "2019-04-08 08:57:11.972454"], ["synced_id", 1], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.975944"], ["updated_at", "2019-04-08 08:57:11.975944"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.979664"], ["updated_at", "2019-04-08 08:57:11.979664"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.983341"], ["updated_at", "2019-04-08 08:57:11.983341"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:11.995951"], ["updated_at", "2019-04-08 08:57:11.995951"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.003924"], ["updated_at", "2019-04-08 08:57:12.003924"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:12.013803"], ["updated_at", "2019-04-08 08:57:12.013803"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.020474"], ["updated_at", "2019-04-08 08:57:12.020474"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:57:12.028862"], ["updated_at", "2019-04-08 08:57:12.028862"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627432"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 457], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:12.034432"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886632"], ["id", 457]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 457]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:57:12.045225"], ["updated_at", "2019-04-08 08:57:12.045225"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800232"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:12.053301"], ["updated_at", "2019-04-08 08:57:12.053301"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.060980"], ["updated_at", "2019-04-08 08:57:12.060980"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.068616"], ["updated_at", "2019-04-08 08:57:12.068616"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:12.076501"], ["updated_at", "2019-04-08 08:57:12.076501"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 460], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:12.080944"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 460]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 460], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.091889"], ["updated_at", "2019-04-08 08:57:12.091889"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.107537"], ["updated_at", "2019-04-08 08:57:12.107537"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.128069"], ["updated_at", "2019-04-08 08:57:12.128069"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.148514"], ["updated_at", "2019-04-08 08:57:12.148514"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.167051"], ["updated_at", "2019-04-08 08:57:12.167051"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.187520"], ["updated_at", "2019-04-08 08:57:12.187520"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:12.201710"], ["updated_at", "2019-04-08 08:57:12.201710"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:12.214031"], ["updated_at", "2019-04-08 08:57:12.214031"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:12.223722"], ["updated_at", "2019-04-08 08:57:12.223722"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:12.227564"], ["updated_at", "2019-04-08 08:57:12.227564"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:47.251564"], ["updated_at", "2019-04-08 08:57:47.251564"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:47.259989"], ["updated_at", "2019-04-08 08:57:47.259989"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.297395"], ["updated_at", "2019-04-08 08:57:47.297395"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:47.308105"], ["updated_at", "2019-04-08 08:57:47.308105"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.315597"], ["updated_at", "2019-04-08 08:57:47.315597"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:47.320135"], ["updated_at", "2019-04-08 08:57:47.320135"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.326596"], ["updated_at", "2019-04-08 08:57:47.326596"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:47.332394"], ["updated_at", "2019-04-08 08:57:47.332394"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.5ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.345106"], ["updated_at", "2019-04-08 08:57:47.345106"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:47.354005"], ["updated_at", "2019-04-08 08:57:47.354005"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.361885"], ["updated_at", "2019-04-08 08:57:47.361885"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.365247"], ["updated_at", "2019-04-08 08:57:47.365247"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 432], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:47.372052"], ["id", 432]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 432], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.382677"], ["updated_at", "2019-04-08 08:57:47.382677"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.386859"], ["updated_at", "2019-04-08 08:57:47.386859"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 434], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:47.392889"], ["id", 434]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 434], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.402144"], ["updated_at", "2019-04-08 08:57:47.402144"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.409044"], ["updated_at", "2019-04-08 08:57:47.409044"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 436], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:47.418982"], ["id", 436]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.426818"], ["updated_at", "2019-04-08 08:57:47.426818"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.431048"], ["updated_at", "2019-04-08 08:57:47.431048"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 438], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:47.436293"], ["id", 438]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.443117"], ["updated_at", "2019-04-08 08:57:47.443117"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 439], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:47.447069"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 439]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 439], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:57:47.458912"], ["updated_at", "2019-04-08 08:57:47.458912"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:57:47.462495"], ["synced_id", 0], ["id", 440]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:47.490354"], ["updated_at", "2019-04-08 08:57:47.490354"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:47.501444"], ["updated_at", "2019-04-08 08:57:47.501444"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:47.516637"], ["updated_at", "2019-04-08 08:57:47.516637"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:47.520609"], ["updated_at", "2019-04-08 08:57:47.520609"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:47.524471"], ["updated_at", "2019-04-08 08:57:47.524471"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:47.533236"], ["updated_at", "2019-04-08 08:57:47.533236"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800267"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:47.540619"], ["updated_at", "2019-04-08 08:57:47.540619"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627467"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 446], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:47.544872"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886667"], ["id", 446]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 446]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:57:47.565839"], ["updated_at", "2019-04-08 08:57:47.565839"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.579947"], ["updated_at", "2019-04-08 08:57:47.579947"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.585409"], ["updated_at", "2019-04-08 08:57:47.585409"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:47.615675"], ["updated_at", "2019-04-08 08:57:47.615675"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (0.7ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:47.628723"], ["updated_at", "2019-04-08 08:57:47.628723"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 5.9ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:47.644043"], ["updated_at", "2019-04-08 08:57:47.644043"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 3.9ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:57:47.659559"], ["updated_at", "2019-04-08 08:57:47.659559"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.2ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.698745"], ["updated_at", "2019-04-08 08:57:47.698745"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.716236"], ["updated_at", "2019-04-08 08:57:47.716236"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:47.728605"], ["updated_at", "2019-04-08 08:57:47.728605"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:57:47.735153"], ["updated_at", "2019-04-08 08:57:47.735153"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800267"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:57:47.744310"], ["updated_at", "2019-04-08 08:57:47.744310"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627467"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 470], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:47.755344"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886667"], ["id", 470]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 470]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.776034"], ["updated_at", "2019-04-08 08:57:47.776034"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.780649"], ["updated_at", "2019-04-08 08:57:47.780649"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.785076"], ["updated_at", "2019-04-08 08:57:47.785076"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.792961"], ["updated_at", "2019-04-08 08:57:47.792961"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.801095"], ["updated_at", "2019-04-08 08:57:47.801095"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.804849"], ["updated_at", "2019-04-08 08:57:47.804849"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.812977"], ["updated_at", "2019-04-08 08:57:47.812977"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.820169"], ["updated_at", "2019-04-08 08:57:47.820169"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:47.827775"], ["updated_at", "2019-04-08 08:57:47.827775"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:47.843406"], ["updated_at", "2019-04-08 08:57:47.843406"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.847359"], ["updated_at", "2019-04-08 08:57:47.847359"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:47.856121"], ["updated_at", "2019-04-08 08:57:47.856121"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.859833"], ["updated_at", "2019-04-08 08:57:47.859833"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:57:47.868343"], ["updated_at", "2019-04-08 08:57:47.868343"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.873174"], ["updated_at", "2019-04-08 08:57:47.873174"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.880766"], ["updated_at", "2019-04-08 08:57:47.880766"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.886306"], ["updated_at", "2019-04-08 08:57:47.886306"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 486], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:47.892740"], ["id", 486]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.902085"], ["updated_at", "2019-04-08 08:57:47.902085"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.906570"], ["updated_at", "2019-04-08 08:57:47.906570"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 488], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:47.911833"], ["id", 488]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 488], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.922278"], ["updated_at", "2019-04-08 08:57:47.922278"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.926375"], ["updated_at", "2019-04-08 08:57:47.926375"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 490], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:57:47.931864"], ["id", 490]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 490], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:57:47.939702"], ["updated_at", "2019-04-08 08:57:47.939702"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 492], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:57:47.943547"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 492]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 492], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.950954"], ["updated_at", "2019-04-08 08:57:47.950954"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.957147"], ["updated_at", "2019-04-08 08:57:47.957147"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.962240"], ["updated_at", "2019-04-08 08:57:47.962240"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.969552"], ["updated_at", "2019-04-08 08:57:47.969552"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:57:47.987206"], ["updated_at", "2019-04-08 08:57:47.987206"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:47.995983"], ["updated_at", "2019-04-08 08:57:47.995983"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:48.027098"], ["updated_at", "2019-04-08 08:57:48.027098"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:48.038246"], ["updated_at", "2019-04-08 08:57:48.038246"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:48.061222"], ["updated_at", "2019-04-08 08:57:48.061222"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:48.083688"], ["updated_at", "2019-04-08 08:57:48.083688"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:48.099742"], ["updated_at", "2019-04-08 08:57:48.099742"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:48.111919"], ["updated_at", "2019-04-08 08:57:48.111919"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:57:48.130888"], ["updated_at", "2019-04-08 08:57:48.130888"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (3.5ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:26.999521"], ["updated_at", "2019-04-08 08:58:26.999521"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.6ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (4.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (3.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:27.059538"], ["updated_at", "2019-04-08 08:58:27.059538"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:27.097301"], ["updated_at", "2019-04-08 08:58:27.097301"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (2.2ms) ROLLBACK  (1.3ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (4.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:27.138897"], ["updated_at", "2019-04-08 08:58:27.138897"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:27.179138"], ["updated_at", "2019-04-08 08:58:27.179138"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:27.196619"], ["updated_at", "2019-04-08 08:58:27.196619"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:27.237921"], ["updated_at", "2019-04-08 08:58:27.237921"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.267657"], ["updated_at", "2019-04-08 08:58:27.267657"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.272619"], ["updated_at", "2019-04-08 08:58:27.272619"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:27.289563"], ["updated_at", "2019-04-08 08:58:27.289563"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:27.298762"], ["updated_at", "2019-04-08 08:58:27.298762"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:27.309038"], ["updated_at", "2019-04-08 08:58:27.309038"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 453], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:27.313278"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 453]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 453], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:27.324489"], ["updated_at", "2019-04-08 08:58:27.324489"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:27.328573"], ["updated_at", "2019-04-08 08:58:27.328573"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:27.332564"], ["updated_at", "2019-04-08 08:58:27.332564"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:27.342511"], ["updated_at", "2019-04-08 08:58:27.342511"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:27.349565"], ["updated_at", "2019-04-08 08:58:27.349565"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (3.3ms) ROLLBACK  (2.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:27.386978"], ["updated_at", "2019-04-08 08:58:27.386978"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (4.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.402023"], ["updated_at", "2019-04-08 08:58:27.402023"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.413790"], ["updated_at", "2019-04-08 08:58:27.413790"], ["provider", "bookingsync"], ["synced_id", 123]]  (3.3ms) RELEASE SAVEPOINT active_record_1 Account Load (3.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.5ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 460], ["LIMIT", 1]] Account Update (2.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:27.443969"], ["id", 460]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 460], ["LIMIT", 1]]  (5.9ms) ROLLBACK  (2.6ms) BEGIN  (3.7ms) SAVEPOINT active_record_1 Account Exists (3.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.490164"], ["updated_at", "2019-04-08 08:58:27.490164"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (3.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (5.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.501557"], ["updated_at", "2019-04-08 08:58:27.501557"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.8ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 462], ["LIMIT", 1]] Account Update (3.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:27.524664"], ["id", 462]]  (3.1ms) RELEASE SAVEPOINT active_record_1 Account Load (3.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 462], ["LIMIT", 1]]  (2.2ms) ROLLBACK  (1.6ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (4.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.557004"], ["updated_at", "2019-04-08 08:58:27.557004"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.574947"], ["updated_at", "2019-04-08 08:58:27.574947"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 464], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:27.589741"], ["id", 464]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.9ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.604580"], ["updated_at", "2019-04-08 08:58:27.604580"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.611847"], ["updated_at", "2019-04-08 08:58:27.611847"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (3.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 466], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:27.625679"], ["id", 466]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (4.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.646041"], ["updated_at", "2019-04-08 08:58:27.646041"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:27.659077"], ["updated_at", "2019-04-08 08:58:27.659077"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.668724"], ["updated_at", "2019-04-08 08:58:27.668724"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.3ms) SAVEPOINT active_record_1 Account Exists (4.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:27.685650"], ["updated_at", "2019-04-08 08:58:27.685650"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.697424"], ["updated_at", "2019-04-08 08:58:27.697424"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (3.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:27.713196"], ["updated_at", "2019-04-08 08:58:27.713196"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:27.722684"], ["updated_at", "2019-04-08 08:58:27.722684"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (2.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:27.733403"], ["updated_at", "2019-04-08 08:58:27.733403"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:27.740391"], ["updated_at", "2019-04-08 08:58:27.740391"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627507"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (3.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 475], ["LIMIT", 1]] Account Update (3.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:27.755395"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886707"], ["id", 475]]  (2.5ms) RELEASE SAVEPOINT active_record_1 Account Load (2.8ms) SELECT "accounts".* FROM "accounts"  (2.7ms) SAVEPOINT active_record_1 Account Destroy (3.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 475]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:27.785194"], ["updated_at", "2019-04-08 08:58:27.785194"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800307"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:58:27.814711"], ["updated_at", "2019-04-08 08:58:27.814711"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Update (2.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:58:27.819194"], ["synced_id", 0], ["id", 477]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (2.1ms) ROLLBACK  (1.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (2.7ms) ROLLBACK  (2.0ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (2.2ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.8ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:27.925256"], ["updated_at", "2019-04-08 08:58:27.925256"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 13.4ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:27.943751"], ["updated_at", "2019-04-08 08:58:27.943751"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.3ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:27.957837"], ["updated_at", "2019-04-08 08:58:27.957837"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.3ms)  (1.7ms) SELECT COUNT(*) FROM "accounts" Account Load (1.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:27.988719"], ["updated_at", "2019-04-08 08:58:27.988719"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 7.4ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (2.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:28.033306"], ["updated_at", "2019-04-08 08:58:28.033306"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:28.038325"], ["updated_at", "2019-04-08 08:58:28.038325"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:28.044622"], ["updated_at", "2019-04-08 08:58:28.044622"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:28.049609"], ["updated_at", "2019-04-08 08:58:28.049609"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:28.061101"], ["updated_at", "2019-04-08 08:58:28.061101"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.068669"], ["updated_at", "2019-04-08 08:58:28.068669"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.078356"], ["updated_at", "2019-04-08 08:58:28.078356"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.092215"], ["updated_at", "2019-04-08 08:58:28.092215"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.095969"], ["updated_at", "2019-04-08 08:58:28.095969"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.104541"], ["updated_at", "2019-04-08 08:58:28.104541"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.109151"], ["updated_at", "2019-04-08 08:58:28.109151"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 508], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:28.114736"], ["id", 508]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.122472"], ["updated_at", "2019-04-08 08:58:28.122472"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.127210"], ["updated_at", "2019-04-08 08:58:28.127210"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 510], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:28.133157"], ["id", 510]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 510], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.144045"], ["updated_at", "2019-04-08 08:58:28.144045"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.149118"], ["updated_at", "2019-04-08 08:58:28.149118"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 512], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:28.155238"], ["id", 512]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 512], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.165070"], ["updated_at", "2019-04-08 08:58:28.165070"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.168620"], ["updated_at", "2019-04-08 08:58:28.168620"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:28.175406"], ["updated_at", "2019-04-08 08:58:28.175406"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:28.184404"], ["updated_at", "2019-04-08 08:58:28.184404"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.188633"], ["updated_at", "2019-04-08 08:58:28.188633"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:28.197223"], ["updated_at", "2019-04-08 08:58:28.197223"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.201386"], ["updated_at", "2019-04-08 08:58:28.201386"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:28.210690"], ["updated_at", "2019-04-08 08:58:28.210690"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.215369"], ["updated_at", "2019-04-08 08:58:28.215369"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:28.222606"], ["updated_at", "2019-04-08 08:58:28.222606"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.230199"], ["updated_at", "2019-04-08 08:58:28.230199"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.236523"], ["updated_at", "2019-04-08 08:58:28.236523"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:28.244536"], ["updated_at", "2019-04-08 08:58:28.244536"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:28.250044"], ["updated_at", "2019-04-08 08:58:28.250044"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:28.257018"], ["updated_at", "2019-04-08 08:58:28.257018"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 525], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:28.260800"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 525]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 525], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:28.270679"], ["updated_at", "2019-04-08 08:58:28.270679"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:58:28.283233"], ["updated_at", "2019-04-08 08:58:28.283233"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627508"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 527], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:28.288671"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886708"], ["id", 527]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 527]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:58:28.300836"], ["updated_at", "2019-04-08 08:58:28.300836"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800308"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.513541"], ["updated_at", "2019-04-08 08:58:33.513541"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:58:33.536421"], ["updated_at", "2019-04-08 08:58:33.536421"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800313"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 08:58:33.555457"], ["updated_at", "2019-04-08 08:58:33.555457"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627513"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 531], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:33.561104"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886713"], ["id", 531]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.3ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 531]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:33.580111"], ["updated_at", "2019-04-08 08:58:33.580111"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.589636"], ["updated_at", "2019-04-08 08:58:33.589636"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.594251"], ["updated_at", "2019-04-08 08:58:33.594251"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:33.604108"], ["updated_at", "2019-04-08 08:58:33.604108"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:33.616012"], ["updated_at", "2019-04-08 08:58:33.616012"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.620106"], ["updated_at", "2019-04-08 08:58:33.620106"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:33.628524"], ["updated_at", "2019-04-08 08:58:33.628524"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.632343"], ["updated_at", "2019-04-08 08:58:33.632343"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:33.640298"], ["updated_at", "2019-04-08 08:58:33.640298"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.644566"], ["updated_at", "2019-04-08 08:58:33.644566"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.651905"], ["updated_at", "2019-04-08 08:58:33.651905"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.655671"], ["updated_at", "2019-04-08 08:58:33.655671"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 542], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:33.660992"], ["id", 542]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.667320"], ["updated_at", "2019-04-08 08:58:33.667320"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.673151"], ["updated_at", "2019-04-08 08:58:33.673151"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 544], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:33.682595"], ["id", 544]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 544], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.694729"], ["updated_at", "2019-04-08 08:58:33.694729"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.699123"], ["updated_at", "2019-04-08 08:58:33.699123"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 546], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:33.704771"], ["id", 546]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 546], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.712171"], ["updated_at", "2019-04-08 08:58:33.712171"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.716241"], ["updated_at", "2019-04-08 08:58:33.716241"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.724047"], ["updated_at", "2019-04-08 08:58:33.724047"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.728236"], ["updated_at", "2019-04-08 08:58:33.728236"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.731581"], ["updated_at", "2019-04-08 08:58:33.731581"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.735485"], ["updated_at", "2019-04-08 08:58:33.735485"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.745003"], ["updated_at", "2019-04-08 08:58:33.745003"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.759819"], ["updated_at", "2019-04-08 08:58:33.759819"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.765413"], ["updated_at", "2019-04-08 08:58:33.765413"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.774895"], ["updated_at", "2019-04-08 08:58:33.774895"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.780596"], ["updated_at", "2019-04-08 08:58:33.780596"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.789097"], ["updated_at", "2019-04-08 08:58:33.789097"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.794818"], ["updated_at", "2019-04-08 08:58:33.794818"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:33.803270"], ["updated_at", "2019-04-08 08:58:33.803270"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 557], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:33.807143"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 557]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 557], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:33.864080"], ["updated_at", "2019-04-08 08:58:33.864080"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 22ms (ActiveRecord: 9.8ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:33.874037"], ["updated_at", "2019-04-08 08:58:33.874037"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 3.2ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 08:58:33.889049"], ["updated_at", "2019-04-08 08:58:33.889049"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.9ms)  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:33.909038"], ["updated_at", "2019-04-08 08:58:33.909038"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:33.943909"], ["updated_at", "2019-04-08 08:58:33.943909"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:33.952975"], ["updated_at", "2019-04-08 08:58:33.952975"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 485], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:33.957487"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 485]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 485], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.965895"], ["updated_at", "2019-04-08 08:58:33.965895"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.969585"], ["updated_at", "2019-04-08 08:58:33.969585"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 487], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:33.974760"], ["id", 487]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.5ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.987402"], ["updated_at", "2019-04-08 08:58:33.987402"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:33.991442"], ["updated_at", "2019-04-08 08:58:33.991442"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 489], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:33.996011"], ["id", 489]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 489], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.004555"], ["updated_at", "2019-04-08 08:58:34.004555"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.008198"], ["updated_at", "2019-04-08 08:58:34.008198"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 491], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:34.014185"], ["id", 491]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 491], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.023363"], ["updated_at", "2019-04-08 08:58:34.023363"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.027295"], ["updated_at", "2019-04-08 08:58:34.027295"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 493], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 08:58:34.032535"], ["id", 493]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.038919"], ["updated_at", "2019-04-08 08:58:34.038919"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:34.044834"], ["updated_at", "2019-04-08 08:58:34.044834"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.053172"], ["updated_at", "2019-04-08 08:58:34.053172"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:34.058473"], ["updated_at", "2019-04-08 08:58:34.058473"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.064521"], ["updated_at", "2019-04-08 08:58:34.064521"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:34.069542"], ["updated_at", "2019-04-08 08:58:34.069542"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.077801"], ["updated_at", "2019-04-08 08:58:34.077801"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 08:58:34.083817"], ["updated_at", "2019-04-08 08:58:34.083817"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:34.091303"], ["updated_at", "2019-04-08 08:58:34.091303"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:34.096062"], ["updated_at", "2019-04-08 08:58:34.096062"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:34.100218"], ["updated_at", "2019-04-08 08:58:34.100218"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:34.113401"], ["updated_at", "2019-04-08 08:58:34.113401"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 08:58:34.123568"], ["updated_at", "2019-04-08 08:58:34.123568"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 08:58:34.127125"], ["synced_id", 0], ["id", 506]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:34.137124"], ["updated_at", "2019-04-08 08:58:34.137124"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:34.158402"], ["updated_at", "2019-04-08 08:58:34.158402"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800314"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:34.167427"], ["updated_at", "2019-04-08 08:58:34.167427"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627514"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 509], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 08:58:34.175270"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886714"], ["id", 509]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (0.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 509]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 08:58:34.188424"], ["updated_at", "2019-04-08 08:58:34.188424"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.226280"], ["updated_at", "2019-04-08 08:58:34.226280"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 08:58:34.230654"], ["updated_at", "2019-04-08 08:58:34.230654"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 08:58:34.239931"], ["updated_at", "2019-04-08 08:58:34.239931"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:34.252615"], ["updated_at", "2019-04-08 08:58:34.252615"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:34.278310"], ["updated_at", "2019-04-08 08:58:34.278310"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:34.295783"], ["updated_at", "2019-04-08 08:58:34.295783"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:34.320010"], ["updated_at", "2019-04-08 08:58:34.320010"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:34.333610"], ["updated_at", "2019-04-08 08:58:34.333610"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:34.355207"], ["updated_at", "2019-04-08 08:58:34.355207"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 08:58:34.369669"], ["updated_at", "2019-04-08 08:58:34.369669"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:57.740083"], ["updated_at", "2019-04-08 09:00:57.740083"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:57.769517"], ["updated_at", "2019-04-08 09:00:57.769517"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:57.786881"], ["updated_at", "2019-04-08 09:00:57.786881"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:57.827340"], ["updated_at", "2019-04-08 09:00:57.827340"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:57.845386"], ["updated_at", "2019-04-08 09:00:57.845386"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:57.871152"], ["updated_at", "2019-04-08 09:00:57.871152"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:00:57.933067"], ["updated_at", "2019-04-08 09:00:57.933067"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:57.962691"], ["updated_at", "2019-04-08 09:00:57.962691"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:57.967565"], ["updated_at", "2019-04-08 09:00:57.967565"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:00:57.977042"], ["updated_at", "2019-04-08 09:00:57.977042"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:00:57.984357"], ["updated_at", "2019-04-08 09:00:57.984357"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:00:57.987582"], ["updated_at", "2019-04-08 09:00:57.987582"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:00:57.991455"], ["updated_at", "2019-04-08 09:00:57.991455"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:00:57.998545"], ["updated_at", "2019-04-08 09:00:57.998545"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:00:58.011968"], ["updated_at", "2019-04-08 09:00:58.011968"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.4ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:00:58.022077"], ["updated_at", "2019-04-08 09:00:58.022077"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:00:58.025757"], ["synced_id", 0], ["id", 517]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.036510"], ["updated_at", "2019-04-08 09:00:58.036510"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:00:58.045986"], ["updated_at", "2019-04-08 09:00:58.045986"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.054356"], ["updated_at", "2019-04-08 09:00:58.054356"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:00:58.060832"], ["updated_at", "2019-04-08 09:00:58.060832"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.068257"], ["updated_at", "2019-04-08 09:00:58.068257"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:00:58.074055"], ["updated_at", "2019-04-08 09:00:58.074055"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.080971"], ["updated_at", "2019-04-08 09:00:58.080971"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:00:58.086440"], ["updated_at", "2019-04-08 09:00:58.086440"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.094266"], ["updated_at", "2019-04-08 09:00:58.094266"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.097782"], ["updated_at", "2019-04-08 09:00:58.097782"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 527], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:00:58.103172"], ["id", 527]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.110072"], ["updated_at", "2019-04-08 09:00:58.110072"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.113478"], ["updated_at", "2019-04-08 09:00:58.113478"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 529], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:00:58.119097"], ["id", 529]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 529], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.127940"], ["updated_at", "2019-04-08 09:00:58.127940"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.131454"], ["updated_at", "2019-04-08 09:00:58.131454"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 531], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:00:58.136230"], ["id", 531]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 531], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.144537"], ["updated_at", "2019-04-08 09:00:58.144537"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.148152"], ["updated_at", "2019-04-08 09:00:58.148152"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 533], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:00:58.153113"], ["id", 533]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.160449"], ["updated_at", "2019-04-08 09:00:58.160449"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 534], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:00:58.164171"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 534]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 534], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:00:58.171114"], ["updated_at", "2019-04-08 09:00:58.171114"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:00:58.193703"], ["updated_at", "2019-04-08 09:00:58.193703"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800458"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:00:58.200105"], ["updated_at", "2019-04-08 09:00:58.200105"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627658"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 537], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:00:58.204174"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886858"], ["id", 537]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 537]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.231405"], ["updated_at", "2019-04-08 09:00:58.231405"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.241929"], ["updated_at", "2019-04-08 09:00:58.241929"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.248124"], ["updated_at", "2019-04-08 09:00:58.248124"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.253665"], ["updated_at", "2019-04-08 09:00:58.253665"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.264189"], ["updated_at", "2019-04-08 09:00:58.264189"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.269636"], ["updated_at", "2019-04-08 09:00:58.269636"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.277136"], ["updated_at", "2019-04-08 09:00:58.277136"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.282971"], ["updated_at", "2019-04-08 09:00:58.282971"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:00:58.292919"], ["updated_at", "2019-04-08 09:00:58.292919"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554627658"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 568], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:00:58.297825"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554886858"], ["id", 568]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 568]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:00:58.308664"], ["updated_at", "2019-04-08 09:00:58.308664"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554800458"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:00:58.317063"], ["updated_at", "2019-04-08 09:00:58.317063"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.324635"], ["updated_at", "2019-04-08 09:00:58.324635"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.328929"], ["updated_at", "2019-04-08 09:00:58.328929"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:00:58.336685"], ["updated_at", "2019-04-08 09:00:58.336685"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:00:58.345767"], ["updated_at", "2019-04-08 09:00:58.345767"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.349612"], ["updated_at", "2019-04-08 09:00:58.349612"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:00:58.357907"], ["updated_at", "2019-04-08 09:00:58.357907"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.361881"], ["updated_at", "2019-04-08 09:00:58.361881"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:00:58.370023"], ["updated_at", "2019-04-08 09:00:58.370023"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.375212"], ["updated_at", "2019-04-08 09:00:58.375212"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.382666"], ["updated_at", "2019-04-08 09:00:58.382666"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.386805"], ["updated_at", "2019-04-08 09:00:58.386805"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 580], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:00:58.393989"], ["id", 580]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.401552"], ["updated_at", "2019-04-08 09:00:58.401552"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.405631"], ["updated_at", "2019-04-08 09:00:58.405631"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 582], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:00:58.412626"], ["id", 582]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 582], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.422926"], ["updated_at", "2019-04-08 09:00:58.422926"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.427936"], ["updated_at", "2019-04-08 09:00:58.427936"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 584], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:00:58.433753"], ["id", 584]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 584], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.442790"], ["updated_at", "2019-04-08 09:00:58.442790"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.446476"], ["updated_at", "2019-04-08 09:00:58.446476"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.453676"], ["updated_at", "2019-04-08 09:00:58.453676"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.457663"], ["updated_at", "2019-04-08 09:00:58.457663"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.461603"], ["updated_at", "2019-04-08 09:00:58.461603"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:00:58.465787"], ["updated_at", "2019-04-08 09:00:58.465787"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:00:58.474467"], ["updated_at", "2019-04-08 09:00:58.474467"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 592], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:00:58.479096"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 592]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 592], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:00:58.487566"], ["updated_at", "2019-04-08 09:00:58.487566"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:00:58.518896"], ["updated_at", "2019-04-08 09:00:58.518896"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 3.7ms)  (1.2ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:00:58.531524"], ["updated_at", "2019-04-08 09:00:58.531524"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.5ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:00:58.544891"], ["updated_at", "2019-04-08 09:00:58.544891"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:00:58.563465"], ["updated_at", "2019-04-08 09:00:58.563465"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:13:40.672285"], ["updated_at", "2019-04-08 09:13:40.672285"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:13:40.691249"], ["updated_at", "2019-04-08 09:13:40.691249"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:13:40.695051"], ["updated_at", "2019-04-08 09:13:40.695051"], ["synced_id", 2]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:13:40.701124"], ["updated_at", "2019-04-08 09:13:40.701124"], ["synced_id", 3]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:13:40.721650"], ["updated_at", "2019-04-08 09:13:40.721650"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:40.735624"], ["updated_at", "2019-04-08 09:13:40.735624"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 546], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:13:40.744577"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 546]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 546], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:13:40.760490"], ["updated_at", "2019-04-08 09:13:40.760490"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801220"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:13:40.773173"], ["updated_at", "2019-04-08 09:13:40.773173"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628420"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 548], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:13:40.781161"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554887620"], ["id", 548]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.8ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 548]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:13:40.799083"], ["updated_at", "2019-04-08 09:13:40.799083"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:13:40.803206"], ["synced_id", 0], ["id", 549]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.830211"], ["updated_at", "2019-04-08 09:13:40.830211"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:13:40.843397"], ["updated_at", "2019-04-08 09:13:40.843397"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.853685"], ["updated_at", "2019-04-08 09:13:40.853685"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:13:40.860327"], ["updated_at", "2019-04-08 09:13:40.860327"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.869316"], ["updated_at", "2019-04-08 09:13:40.869316"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:13:40.875832"], ["updated_at", "2019-04-08 09:13:40.875832"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.885949"], ["updated_at", "2019-04-08 09:13:40.885949"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:13:40.892305"], ["updated_at", "2019-04-08 09:13:40.892305"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.902438"], ["updated_at", "2019-04-08 09:13:40.902438"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.907181"], ["updated_at", "2019-04-08 09:13:40.907181"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 559], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:13:40.914337"], ["id", 559]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.923127"], ["updated_at", "2019-04-08 09:13:40.923127"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.927997"], ["updated_at", "2019-04-08 09:13:40.927997"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 561], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:13:40.935691"], ["id", 561]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 561], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.945968"], ["updated_at", "2019-04-08 09:13:40.945968"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.951516"], ["updated_at", "2019-04-08 09:13:40.951516"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 563], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:13:40.959516"], ["id", 563]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 563], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.970625"], ["updated_at", "2019-04-08 09:13:40.970625"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:40.975693"], ["updated_at", "2019-04-08 09:13:40.975693"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 565], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:13:40.982715"], ["id", 565]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:13:41.016732"], ["updated_at", "2019-04-08 09:13:41.016732"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:13:41.025454"], ["updated_at", "2019-04-08 09:13:41.025454"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:13:41.080169"], ["updated_at", "2019-04-08 09:13:41.080169"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.5ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:13:41.092319"], ["updated_at", "2019-04-08 09:13:41.092319"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.0ms)  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:13:41.105944"], ["updated_at", "2019-04-08 09:13:41.105944"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.7ms)  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:13:41.122382"], ["updated_at", "2019-04-08 09:13:41.122382"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.6ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.190052"], ["updated_at", "2019-04-08 09:13:41.190052"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.218232"], ["updated_at", "2019-04-08 09:13:41.218232"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.240786"], ["updated_at", "2019-04-08 09:13:41.240786"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.254552"], ["updated_at", "2019-04-08 09:13:41.254552"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.269454"], ["updated_at", "2019-04-08 09:13:41.269454"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.284511"], ["updated_at", "2019-04-08 09:13:41.284511"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:13:41.306686"], ["updated_at", "2019-04-08 09:13:41.306686"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628421"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 597], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:13:41.312726"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554887621"], ["id", 597]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 597]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:13:41.324601"], ["updated_at", "2019-04-08 09:13:41.324601"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801221"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.333755"], ["updated_at", "2019-04-08 09:13:41.333755"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.341093"], ["updated_at", "2019-04-08 09:13:41.341093"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.351774"], ["updated_at", "2019-04-08 09:13:41.351774"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.367283"], ["updated_at", "2019-04-08 09:13:41.367283"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.373845"], ["updated_at", "2019-04-08 09:13:41.373845"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.384325"], ["updated_at", "2019-04-08 09:13:41.384325"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.390857"], ["updated_at", "2019-04-08 09:13:41.390857"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.401113"], ["updated_at", "2019-04-08 09:13:41.401113"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:13:41.420455"], ["updated_at", "2019-04-08 09:13:41.420455"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 603], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:13:41.426000"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 603]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 603], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.437714"], ["updated_at", "2019-04-08 09:13:41.437714"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.442451"], ["updated_at", "2019-04-08 09:13:41.442451"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.447930"], ["updated_at", "2019-04-08 09:13:41.447930"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.452965"], ["updated_at", "2019-04-08 09:13:41.452965"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.465397"], ["updated_at", "2019-04-08 09:13:41.465397"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.470082"], ["updated_at", "2019-04-08 09:13:41.470082"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 608], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:13:41.476137"], ["id", 608]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.484586"], ["updated_at", "2019-04-08 09:13:41.484586"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.489248"], ["updated_at", "2019-04-08 09:13:41.489248"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 610], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:13:41.494606"], ["id", 610]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 610], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.502723"], ["updated_at", "2019-04-08 09:13:41.502723"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.506353"], ["updated_at", "2019-04-08 09:13:41.506353"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 612], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:13:41.511506"], ["id", 612]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 612], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.522084"], ["updated_at", "2019-04-08 09:13:41.522084"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.526426"], ["updated_at", "2019-04-08 09:13:41.526426"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:13:41.534452"], ["updated_at", "2019-04-08 09:13:41.534452"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:13:41.544763"], ["updated_at", "2019-04-08 09:13:41.544763"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.549820"], ["updated_at", "2019-04-08 09:13:41.549820"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:13:41.558608"], ["updated_at", "2019-04-08 09:13:41.558608"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.563750"], ["updated_at", "2019-04-08 09:13:41.563750"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:13:41.572513"], ["updated_at", "2019-04-08 09:13:41.572513"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.576449"], ["updated_at", "2019-04-08 09:13:41.576449"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.584662"], ["updated_at", "2019-04-08 09:13:41.584662"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.589391"], ["updated_at", "2019-04-08 09:13:41.589391"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:13:41.599190"], ["updated_at", "2019-04-08 09:13:41.599190"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:13:41.609144"], ["updated_at", "2019-04-08 09:13:41.609144"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:13:41.619993"], ["updated_at", "2019-04-08 09:13:41.619993"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.631641"], ["updated_at", "2019-04-08 09:13:41.631641"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:13:41.636611"], ["updated_at", "2019-04-08 09:13:41.636611"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:14:01.885546"], ["updated_at", "2019-04-08 09:14:01.885546"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:14:01.895986"], ["updated_at", "2019-04-08 09:14:01.895986"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628441"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 572], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:14:01.917553"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554887641"], ["id", 572]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (1.0ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 572]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:14:01.933241"], ["updated_at", "2019-04-08 09:14:01.933241"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801241"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:14:01.955459"], ["updated_at", "2019-04-08 09:14:01.955459"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:14:01.959407"], ["synced_id", 0], ["id", 574]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:14:01.975367"], ["updated_at", "2019-04-08 09:14:01.975367"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:14:01.980534"], ["updated_at", "2019-04-08 09:14:01.980534"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:14:01.985109"], ["updated_at", "2019-04-08 09:14:01.985109"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:14:01.993800"], ["updated_at", "2019-04-08 09:14:01.993800"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:14:02.000962"], ["updated_at", "2019-04-08 09:14:02.000962"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.026870"], ["updated_at", "2019-04-08 09:14:02.026870"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:14:02.042384"], ["updated_at", "2019-04-08 09:14:02.042384"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts"  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.056939"], ["updated_at", "2019-04-08 09:14:02.056939"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:14:02.064963"], ["updated_at", "2019-04-08 09:14:02.064963"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.3ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.080490"], ["updated_at", "2019-04-08 09:14:02.080490"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:14:02.093634"], ["updated_at", "2019-04-08 09:14:02.093634"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.106542"], ["updated_at", "2019-04-08 09:14:02.106542"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:14:02.116186"], ["updated_at", "2019-04-08 09:14:02.116186"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.130725"], ["updated_at", "2019-04-08 09:14:02.130725"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.140173"], ["updated_at", "2019-04-08 09:14:02.140173"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 589], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:14:02.150364"], ["id", 589]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.4ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.163711"], ["updated_at", "2019-04-08 09:14:02.163711"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.170444"], ["updated_at", "2019-04-08 09:14:02.170444"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 591], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:14:02.178253"], ["id", 591]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (2.9ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.192549"], ["updated_at", "2019-04-08 09:14:02.192549"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.199340"], ["updated_at", "2019-04-08 09:14:02.199340"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 593], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:14:02.207253"], ["id", 593]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 593], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.220683"], ["updated_at", "2019-04-08 09:14:02.220683"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.227507"], ["updated_at", "2019-04-08 09:14:02.227507"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 595], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:14:02.235276"], ["id", 595]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 595], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:14:02.263120"], ["updated_at", "2019-04-08 09:14:02.263120"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.272456"], ["updated_at", "2019-04-08 09:14:02.272456"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 596], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:14:02.277124"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 596]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 596], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:14:02.286316"], ["updated_at", "2019-04-08 09:14:02.286316"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 629], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:14:02.291027"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 629]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 629], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.309144"], ["updated_at", "2019-04-08 09:14:02.309144"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.336505"], ["updated_at", "2019-04-08 09:14:02.336505"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.345802"], ["updated_at", "2019-04-08 09:14:02.345802"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:14:02.357382"], ["updated_at", "2019-04-08 09:14:02.357382"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.365607"], ["updated_at", "2019-04-08 09:14:02.365607"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.371340"], ["updated_at", "2019-04-08 09:14:02.371340"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.382561"], ["updated_at", "2019-04-08 09:14:02.382561"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.394233"], ["updated_at", "2019-04-08 09:14:02.394233"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.4ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:14:02.414983"], ["updated_at", "2019-04-08 09:14:02.414983"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628442"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 634], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:14:02.424321"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554887642"], ["id", 634]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 634]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:14:02.441522"], ["updated_at", "2019-04-08 09:14:02.441522"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801242"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.450457"], ["updated_at", "2019-04-08 09:14:02.450457"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.455845"], ["updated_at", "2019-04-08 09:14:02.455845"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:14:02.467229"], ["updated_at", "2019-04-08 09:14:02.467229"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.3ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:14:02.482365"], ["updated_at", "2019-04-08 09:14:02.482365"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.487518"], ["updated_at", "2019-04-08 09:14:02.487518"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:14:02.499288"], ["updated_at", "2019-04-08 09:14:02.499288"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.504486"], ["updated_at", "2019-04-08 09:14:02.504486"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:14:02.515134"], ["updated_at", "2019-04-08 09:14:02.515134"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.519299"], ["updated_at", "2019-04-08 09:14:02.519299"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.530312"], ["updated_at", "2019-04-08 09:14:02.530312"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.536031"], ["updated_at", "2019-04-08 09:14:02.536031"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 645], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:14:02.544861"], ["id", 645]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.553820"], ["updated_at", "2019-04-08 09:14:02.553820"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.561382"], ["updated_at", "2019-04-08 09:14:02.561382"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 647], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:14:02.568127"], ["id", 647]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 647], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.581451"], ["updated_at", "2019-04-08 09:14:02.581451"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.587814"], ["updated_at", "2019-04-08 09:14:02.587814"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 649], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:14:02.597239"], ["id", 649]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 649], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.611776"], ["updated_at", "2019-04-08 09:14:02.611776"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.619815"], ["updated_at", "2019-04-08 09:14:02.619815"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.637352"], ["updated_at", "2019-04-08 09:14:02.637352"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.665303"], ["updated_at", "2019-04-08 09:14:02.665303"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.674476"], ["updated_at", "2019-04-08 09:14:02.674476"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.681551"], ["updated_at", "2019-04-08 09:14:02.681551"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:02.688511"], ["updated_at", "2019-04-08 09:14:02.688511"], ["synced_id", 2], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (2.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (1.6ms) BEGIN  (1.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 7.6ms | ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:14:02.866027"], ["updated_at", "2019-04-08 09:14:02.866027"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 6.9ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:14:02.885050"], ["updated_at", "2019-04-08 09:14:02.885050"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 12ms (ActiveRecord: 7.3ms)  (1.8ms) ROLLBACK  (1.7ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:14:02.910655"], ["updated_at", "2019-04-08 09:14:02.910655"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 8.1ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (2.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:14:02.938319"], ["updated_at", "2019-04-08 09:14:02.938319"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 7.6ms)  (1.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.4ms) BEGIN  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (1.7ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:02.989087"], ["updated_at", "2019-04-08 09:14:02.989087"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:03.008773"], ["updated_at", "2019-04-08 09:14:03.008773"], ["synced_id", 123], ["host", "example.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:14:03.016076"], ["updated_at", "2019-04-08 09:14:03.016076"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (2.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:14:03.035330"], ["updated_at", "2019-04-08 09:14:03.035330"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.4ms) BEGIN  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:03.064712"], ["updated_at", "2019-04-08 09:14:03.064712"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:03.087269"], ["updated_at", "2019-04-08 09:14:03.087269"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:03.101852"], ["updated_at", "2019-04-08 09:14:03.101852"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (5.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:03.135475"], ["updated_at", "2019-04-08 09:14:03.135475"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:03.148910"], ["updated_at", "2019-04-08 09:14:03.148910"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:14:03.169973"], ["updated_at", "2019-04-08 09:14:03.169973"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.8ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:09.931140"], ["updated_at", "2019-04-08 09:20:09.931140"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 43ms (ActiveRecord: 16.1ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:09.948667"], ["updated_at", "2019-04-08 09:20:09.948667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.4ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:09.985366"], ["updated_at", "2019-04-08 09:20:09.985366"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 8.1ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:10.006578"], ["updated_at", "2019-04-08 09:20:10.006578"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.4ms)  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.032692"], ["updated_at", "2019-04-08 09:20:10.032692"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.064005"], ["updated_at", "2019-04-08 09:20:10.064005"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.080739"], ["updated_at", "2019-04-08 09:20:10.080739"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.102774"], ["updated_at", "2019-04-08 09:20:10.102774"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.117102"], ["updated_at", "2019-04-08 09:20:10.117102"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.132599"], ["updated_at", "2019-04-08 09:20:10.132599"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.153530"], ["updated_at", "2019-04-08 09:20:10.153530"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 604], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:10.157609"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 604]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 604], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:10.167246"], ["updated_at", "2019-04-08 09:20:10.167246"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:10.174103"], ["updated_at", "2019-04-08 09:20:10.174103"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:10.198791"], ["updated_at", "2019-04-08 09:20:10.198791"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:20:10.209498"], ["updated_at", "2019-04-08 09:20:10.209498"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:20:10.216247"], ["synced_id", 0], ["id", 608]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.227386"], ["updated_at", "2019-04-08 09:20:10.227386"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:10.236490"], ["updated_at", "2019-04-08 09:20:10.236490"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SELECT COUNT(*) FROM "accounts"  (1.8ms) ROLLBACK  (1.5ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.256749"], ["updated_at", "2019-04-08 09:20:10.256749"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:10.265889"], ["updated_at", "2019-04-08 09:20:10.265889"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.5ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.284951"], ["updated_at", "2019-04-08 09:20:10.284951"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:10.294586"], ["updated_at", "2019-04-08 09:20:10.294586"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.304250"], ["updated_at", "2019-04-08 09:20:10.304250"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:10.311291"], ["updated_at", "2019-04-08 09:20:10.311291"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.321466"], ["updated_at", "2019-04-08 09:20:10.321466"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.327018"], ["updated_at", "2019-04-08 09:20:10.327018"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 618], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:10.333899"], ["id", 618]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 618], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.344836"], ["updated_at", "2019-04-08 09:20:10.344836"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.351652"], ["updated_at", "2019-04-08 09:20:10.351652"], ["provider", "bookingsync"], ["synced_id", 123]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 620], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:10.364198"], ["id", 620]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 620], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.375724"], ["updated_at", "2019-04-08 09:20:10.375724"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.380509"], ["updated_at", "2019-04-08 09:20:10.380509"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 622], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:10.386338"], ["id", 622]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.395049"], ["updated_at", "2019-04-08 09:20:10.395049"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.400003"], ["updated_at", "2019-04-08 09:20:10.400003"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 624], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:10.410872"], ["id", 624]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:10.429039"], ["updated_at", "2019-04-08 09:20:10.429039"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628810"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 625], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:10.434389"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888010"], ["id", 625]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 625]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:10.446052"], ["updated_at", "2019-04-08 09:20:10.446052"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801610"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:10.453386"], ["updated_at", "2019-04-08 09:20:10.453386"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:10.459910"], ["updated_at", "2019-04-08 09:20:10.459910"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:10.463303"], ["updated_at", "2019-04-08 09:20:10.463303"], ["synced_id", 2]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:10.466253"], ["updated_at", "2019-04-08 09:20:10.466253"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.513402"], ["updated_at", "2019-04-08 09:20:10.513402"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.537669"], ["updated_at", "2019-04-08 09:20:10.537669"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.544332"], ["updated_at", "2019-04-08 09:20:10.544332"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:20:10.553127"], ["updated_at", "2019-04-08 09:20:10.553127"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801610"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:20:10.561613"], ["updated_at", "2019-04-08 09:20:10.561613"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628810"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 665], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:10.566894"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888010"], ["id", 665]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 665]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.578165"], ["updated_at", "2019-04-08 09:20:10.578165"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.584522"], ["updated_at", "2019-04-08 09:20:10.584522"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.590892"], ["updated_at", "2019-04-08 09:20:10.590892"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:10.598642"], ["updated_at", "2019-04-08 09:20:10.598642"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.607943"], ["updated_at", "2019-04-08 09:20:10.607943"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.614108"], ["updated_at", "2019-04-08 09:20:10.614108"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.623237"], ["updated_at", "2019-04-08 09:20:10.623237"], ["synced_id", 1], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.629112"], ["updated_at", "2019-04-08 09:20:10.629112"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.633492"], ["updated_at", "2019-04-08 09:20:10.633492"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.637782"], ["updated_at", "2019-04-08 09:20:10.637782"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.646791"], ["updated_at", "2019-04-08 09:20:10.646791"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.650729"], ["updated_at", "2019-04-08 09:20:10.650729"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:10.656146"], ["updated_at", "2019-04-08 09:20:10.656146"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:10.664522"], ["updated_at", "2019-04-08 09:20:10.664522"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.668130"], ["updated_at", "2019-04-08 09:20:10.668130"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:10.676458"], ["updated_at", "2019-04-08 09:20:10.676458"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.680869"], ["updated_at", "2019-04-08 09:20:10.680869"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:10.688527"], ["updated_at", "2019-04-08 09:20:10.688527"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.692972"], ["updated_at", "2019-04-08 09:20:10.692972"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.700037"], ["updated_at", "2019-04-08 09:20:10.700037"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.703917"], ["updated_at", "2019-04-08 09:20:10.703917"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 682], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:10.709067"], ["id", 682]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.716918"], ["updated_at", "2019-04-08 09:20:10.716918"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.720888"], ["updated_at", "2019-04-08 09:20:10.720888"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 684], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:10.726508"], ["id", 684]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 684], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.735601"], ["updated_at", "2019-04-08 09:20:10.735601"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.739490"], ["updated_at", "2019-04-08 09:20:10.739490"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 686], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:10.745438"], ["id", 686]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 686], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.753555"], ["updated_at", "2019-04-08 09:20:10.753555"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.757059"], ["updated_at", "2019-04-08 09:20:10.757059"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:10.773108"], ["updated_at", "2019-04-08 09:20:10.773108"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:10.790715"], ["updated_at", "2019-04-08 09:20:10.790715"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 691], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:10.796331"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 691]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 691], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:10.814919"], ["updated_at", "2019-04-08 09:20:10.814919"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.826643"], ["updated_at", "2019-04-08 09:20:10.826643"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:10.832304"], ["updated_at", "2019-04-08 09:20:10.832304"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.067863"], ["updated_at", "2019-04-08 09:20:20.067863"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.088553"], ["updated_at", "2019-04-08 09:20:20.088553"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.113294"], ["updated_at", "2019-04-08 09:20:20.113294"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.137398"], ["updated_at", "2019-04-08 09:20:20.137398"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.142669"], ["updated_at", "2019-04-08 09:20:20.142669"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.146986"], ["updated_at", "2019-04-08 09:20:20.146986"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.151145"], ["updated_at", "2019-04-08 09:20:20.151145"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:20.160658"], ["updated_at", "2019-04-08 09:20:20.160658"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 700], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:20.164881"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 700]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 700], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.174912"], ["updated_at", "2019-04-08 09:20:20.174912"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.187502"], ["updated_at", "2019-04-08 09:20:20.187502"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.194948"], ["updated_at", "2019-04-08 09:20:20.194948"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.204130"], ["updated_at", "2019-04-08 09:20:20.204130"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.211269"], ["updated_at", "2019-04-08 09:20:20.211269"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:20.221514"], ["updated_at", "2019-04-08 09:20:20.221514"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.229467"], ["updated_at", "2019-04-08 09:20:20.229467"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.233442"], ["updated_at", "2019-04-08 09:20:20.233442"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.242485"], ["updated_at", "2019-04-08 09:20:20.242485"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.247089"], ["updated_at", "2019-04-08 09:20:20.247089"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:20.258318"], ["updated_at", "2019-04-08 09:20:20.258318"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:20.270077"], ["updated_at", "2019-04-08 09:20:20.270077"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.274907"], ["updated_at", "2019-04-08 09:20:20.274907"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:20.284346"], ["updated_at", "2019-04-08 09:20:20.284346"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.289163"], ["updated_at", "2019-04-08 09:20:20.289163"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:20.300292"], ["updated_at", "2019-04-08 09:20:20.300292"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.307829"], ["updated_at", "2019-04-08 09:20:20.307829"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.316593"], ["updated_at", "2019-04-08 09:20:20.316593"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.321622"], ["updated_at", "2019-04-08 09:20:20.321622"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 715], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:20.328492"], ["id", 715]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.339003"], ["updated_at", "2019-04-08 09:20:20.339003"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.343970"], ["updated_at", "2019-04-08 09:20:20.343970"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 717], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:20.350593"], ["id", 717]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 717], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.359932"], ["updated_at", "2019-04-08 09:20:20.359932"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.364460"], ["updated_at", "2019-04-08 09:20:20.364460"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 719], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:20.370290"], ["id", 719]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 719], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:20:20.387100"], ["updated_at", "2019-04-08 09:20:20.387100"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801620"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:20:20.395019"], ["updated_at", "2019-04-08 09:20:20.395019"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628820"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 722], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:20.399789"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888020"], ["id", 722]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 722]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:20.430337"], ["updated_at", "2019-04-08 09:20:20.430337"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.442788"], ["updated_at", "2019-04-08 09:20:20.442788"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.446919"], ["updated_at", "2019-04-08 09:20:20.446919"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.458283"], ["updated_at", "2019-04-08 09:20:20.458283"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.473255"], ["updated_at", "2019-04-08 09:20:20.473255"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.488612"], ["updated_at", "2019-04-08 09:20:20.488612"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.510724"], ["updated_at", "2019-04-08 09:20:20.510724"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.525091"], ["updated_at", "2019-04-08 09:20:20.525091"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.544949"], ["updated_at", "2019-04-08 09:20:20.544949"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:20:20.580449"], ["updated_at", "2019-04-08 09:20:20.580449"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:20:20.583744"], ["synced_id", 0], ["id", 632]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.593859"], ["updated_at", "2019-04-08 09:20:20.593859"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:20.600824"], ["updated_at", "2019-04-08 09:20:20.600824"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.607859"], ["updated_at", "2019-04-08 09:20:20.607859"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:20.612438"], ["updated_at", "2019-04-08 09:20:20.612438"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.618806"], ["updated_at", "2019-04-08 09:20:20.618806"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:20.623810"], ["updated_at", "2019-04-08 09:20:20.623810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.630644"], ["updated_at", "2019-04-08 09:20:20.630644"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:20.636052"], ["updated_at", "2019-04-08 09:20:20.636052"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.643464"], ["updated_at", "2019-04-08 09:20:20.643464"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.647187"], ["updated_at", "2019-04-08 09:20:20.647187"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 642], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:20.652950"], ["id", 642]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 642], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.660666"], ["updated_at", "2019-04-08 09:20:20.660666"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.664359"], ["updated_at", "2019-04-08 09:20:20.664359"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 644], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:20.669364"], ["id", 644]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 644], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.676974"], ["updated_at", "2019-04-08 09:20:20.676974"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.680752"], ["updated_at", "2019-04-08 09:20:20.680752"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 646], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:20.686008"], ["id", 646]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.693232"], ["updated_at", "2019-04-08 09:20:20.693232"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:20:20.697744"], ["updated_at", "2019-04-08 09:20:20.697744"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 648], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:20:20.704684"], ["id", 648]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:20.713700"], ["updated_at", "2019-04-08 09:20:20.713700"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801620"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:20.721438"], ["updated_at", "2019-04-08 09:20:20.721438"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554628820"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 650], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:20.726287"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888020"], ["id", 650]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 650]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:20.739645"], ["updated_at", "2019-04-08 09:20:20.739645"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:20.744119"], ["updated_at", "2019-04-08 09:20:20.744119"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:20.748064"], ["updated_at", "2019-04-08 09:20:20.748064"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:20.756138"], ["updated_at", "2019-04-08 09:20:20.756138"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.763414"], ["updated_at", "2019-04-08 09:20:20.763414"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 655], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:20:20.767709"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 655]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 655], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:20.776218"], ["updated_at", "2019-04-08 09:20:20.776218"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:20:20.797800"], ["updated_at", "2019-04-08 09:20:20.797800"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:20:20.808182"], ["updated_at", "2019-04-08 09:20:20.808182"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (1.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 10ms (Views: 6.1ms | ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:20.916188"], ["updated_at", "2019-04-08 09:20:20.916188"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.5ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:20.929467"], ["updated_at", "2019-04-08 09:20:20.929467"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 5.2ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:20:20.943918"], ["updated_at", "2019-04-08 09:20:20.943918"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.5ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:20:20.960632"], ["updated_at", "2019-04-08 09:20:20.960632"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.2ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:20:20.982174"], ["updated_at", "2019-04-08 09:20:20.982174"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:54.466730"], ["updated_at", "2019-04-08 09:23:54.466730"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.498854"], ["updated_at", "2019-04-08 09:23:54.498854"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:54.534599"], ["updated_at", "2019-04-08 09:23:54.534599"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.545364"], ["updated_at", "2019-04-08 09:23:54.545364"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.554093"], ["updated_at", "2019-04-08 09:23:54.554093"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.2ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:54.565918"], ["updated_at", "2019-04-08 09:23:54.565918"], ["synced_id", 123], ["host", "test.example"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.584706"], ["updated_at", "2019-04-08 09:23:54.584706"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.613650"], ["updated_at", "2019-04-08 09:23:54.613650"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.654555"], ["updated_at", "2019-04-08 09:23:54.654555"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.661063"], ["updated_at", "2019-04-08 09:23:54.661063"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.674698"], ["updated_at", "2019-04-08 09:23:54.674698"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.679931"], ["updated_at", "2019-04-08 09:23:54.679931"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 733], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:23:54.687730"], ["id", 733]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.696555"], ["updated_at", "2019-04-08 09:23:54.696555"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.701836"], ["updated_at", "2019-04-08 09:23:54.701836"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 735], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:23:54.708411"], ["id", 735]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 735], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.719061"], ["updated_at", "2019-04-08 09:23:54.719061"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.723078"], ["updated_at", "2019-04-08 09:23:54.723078"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 737], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:23:54.729258"], ["id", 737]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 737], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.738902"], ["updated_at", "2019-04-08 09:23:54.738902"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.742883"], ["updated_at", "2019-04-08 09:23:54.742883"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:23:54.752578"], ["updated_at", "2019-04-08 09:23:54.752578"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:23:54.762663"], ["updated_at", "2019-04-08 09:23:54.762663"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.766896"], ["updated_at", "2019-04-08 09:23:54.766896"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:23:54.776107"], ["updated_at", "2019-04-08 09:23:54.776107"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.780165"], ["updated_at", "2019-04-08 09:23:54.780165"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:23:54.789118"], ["updated_at", "2019-04-08 09:23:54.789118"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:54.793594"], ["updated_at", "2019-04-08 09:23:54.793594"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:23:54.803220"], ["updated_at", "2019-04-08 09:23:54.803220"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.4ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:23:54.817819"], ["updated_at", "2019-04-08 09:23:54.817819"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629034"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 749], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:23:54.828155"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888234"], ["id", 749]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 749]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:23:54.844323"], ["updated_at", "2019-04-08 09:23:54.844323"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801834"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:23:54.852462"], ["updated_at", "2019-04-08 09:23:54.852462"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 751], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:23:54.857576"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 751]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 751], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:54.867158"], ["updated_at", "2019-04-08 09:23:54.867158"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:54.871766"], ["updated_at", "2019-04-08 09:23:54.871766"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:54.877633"], ["updated_at", "2019-04-08 09:23:54.877633"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:54.881957"], ["updated_at", "2019-04-08 09:23:54.881957"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 13ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:23:54.931741"], ["updated_at", "2019-04-08 09:23:54.931741"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 21ms (ActiveRecord: 9.3ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:23:54.944432"], ["updated_at", "2019-04-08 09:23:54.944432"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.4ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:23:54.954692"], ["updated_at", "2019-04-08 09:23:54.954692"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.1ms)  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:23:54.970293"], ["updated_at", "2019-04-08 09:23:54.970293"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:23:54.993270"], ["updated_at", "2019-04-08 09:23:54.993270"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.004979"], ["updated_at", "2019-04-08 09:23:55.004979"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.010204"], ["updated_at", "2019-04-08 09:23:55.010204"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.026216"], ["updated_at", "2019-04-08 09:23:55.026216"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:23:55.040237"], ["updated_at", "2019-04-08 09:23:55.040237"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:23:55.044212"], ["synced_id", 0], ["id", 665]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.056789"], ["updated_at", "2019-04-08 09:23:55.056789"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:23:55.063572"], ["updated_at", "2019-04-08 09:23:55.063572"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.073048"], ["updated_at", "2019-04-08 09:23:55.073048"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:23:55.078831"], ["updated_at", "2019-04-08 09:23:55.078831"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.086500"], ["updated_at", "2019-04-08 09:23:55.086500"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:23:55.092608"], ["updated_at", "2019-04-08 09:23:55.092608"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.100825"], ["updated_at", "2019-04-08 09:23:55.100825"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:23:55.106476"], ["updated_at", "2019-04-08 09:23:55.106476"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.114167"], ["updated_at", "2019-04-08 09:23:55.114167"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.119151"], ["updated_at", "2019-04-08 09:23:55.119151"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 675], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:23:55.125776"], ["id", 675]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.135546"], ["updated_at", "2019-04-08 09:23:55.135546"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.140624"], ["updated_at", "2019-04-08 09:23:55.140624"], ["provider", "bookingsync"], ["synced_id", 123]]  (6.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 677], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:23:55.153894"], ["id", 677]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.161853"], ["updated_at", "2019-04-08 09:23:55.161853"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.165962"], ["updated_at", "2019-04-08 09:23:55.165962"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 679], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:23:55.171125"], ["id", 679]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 679], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.181007"], ["updated_at", "2019-04-08 09:23:55.181007"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:23:55.186493"], ["updated_at", "2019-04-08 09:23:55.186493"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 681], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:23:55.192492"], ["id", 681]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 681], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:23:55.201263"], ["updated_at", "2019-04-08 09:23:55.201263"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:23:55.229266"], ["updated_at", "2019-04-08 09:23:55.229266"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:23:55.238056"], ["updated_at", "2019-04-08 09:23:55.238056"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:23:55.244520"], ["updated_at", "2019-04-08 09:23:55.244520"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:23:55.252691"], ["updated_at", "2019-04-08 09:23:55.252691"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:23:55.260221"], ["updated_at", "2019-04-08 09:23:55.260221"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.267556"], ["updated_at", "2019-04-08 09:23:55.267556"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 688], ["LIMIT", 1]] Account Update (2.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:23:55.275171"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 688]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 688], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:23:55.293121"], ["updated_at", "2019-04-08 09:23:55.293121"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801835"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:23:55.301915"], ["updated_at", "2019-04-08 09:23:55.301915"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629035"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 690], ["LIMIT", 1]] Account Update (1.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:23:55.312590"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888235"], ["id", 690]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts"  (1.3ms) SAVEPOINT active_record_1 Account Destroy (2.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 690]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:23:55.333932"], ["updated_at", "2019-04-08 09:23:55.333932"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.365996"], ["updated_at", "2019-04-08 09:23:55.365996"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.385005"], ["updated_at", "2019-04-08 09:23:55.385005"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.415974"], ["updated_at", "2019-04-08 09:23:55.415974"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.433568"], ["updated_at", "2019-04-08 09:23:55.433568"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.458462"], ["updated_at", "2019-04-08 09:23:55.458462"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:23:55.494885"], ["updated_at", "2019-04-08 09:23:55.494885"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:19.746722"], ["updated_at", "2019-04-08 09:25:19.746722"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:19.777224"], ["updated_at", "2019-04-08 09:25:19.777224"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:19.810198"], ["updated_at", "2019-04-08 09:25:19.810198"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:19.828690"], ["updated_at", "2019-04-08 09:25:19.828690"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:19.866959"], ["updated_at", "2019-04-08 09:25:19.866959"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:19.888819"], ["updated_at", "2019-04-08 09:25:19.888819"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:25:19.959868"], ["updated_at", "2019-04-08 09:25:19.959868"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:19.984137"], ["updated_at", "2019-04-08 09:25:19.984137"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:19.989092"], ["updated_at", "2019-04-08 09:25:19.989092"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.029373"], ["updated_at", "2019-04-08 09:25:20.029373"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:25:20.042194"], ["updated_at", "2019-04-08 09:25:20.042194"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:25:20.047815"], ["synced_id", 0], ["id", 692]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:25:20.063110"], ["updated_at", "2019-04-08 09:25:20.063110"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.078848"], ["updated_at", "2019-04-08 09:25:20.078848"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 693], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:25:20.082993"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 693]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 693], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:25:20.092636"], ["updated_at", "2019-04-08 09:25:20.092636"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:25:20.097591"], ["updated_at", "2019-04-08 09:25:20.097591"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:25:20.102635"], ["updated_at", "2019-04-08 09:25:20.102635"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.110509"], ["updated_at", "2019-04-08 09:25:20.110509"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.114946"], ["updated_at", "2019-04-08 09:25:20.114946"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 698], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:25:20.124049"], ["id", 698]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.136370"], ["updated_at", "2019-04-08 09:25:20.136370"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.141323"], ["updated_at", "2019-04-08 09:25:20.141323"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 700], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:25:20.146698"], ["id", 700]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.154598"], ["updated_at", "2019-04-08 09:25:20.154598"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.158577"], ["updated_at", "2019-04-08 09:25:20.158577"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 702], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:25:20.163829"], ["id", 702]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 702], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.171676"], ["updated_at", "2019-04-08 09:25:20.171676"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.175018"], ["updated_at", "2019-04-08 09:25:20.175018"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 704], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:25:20.179520"], ["id", 704]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 704], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.188310"], ["updated_at", "2019-04-08 09:25:20.188310"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:25:20.197187"], ["updated_at", "2019-04-08 09:25:20.197187"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.206521"], ["updated_at", "2019-04-08 09:25:20.206521"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:25:20.211614"], ["updated_at", "2019-04-08 09:25:20.211614"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.218509"], ["updated_at", "2019-04-08 09:25:20.218509"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:25:20.224268"], ["updated_at", "2019-04-08 09:25:20.224268"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.230430"], ["updated_at", "2019-04-08 09:25:20.230430"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:25:20.235268"], ["updated_at", "2019-04-08 09:25:20.235268"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:25:20.243261"], ["updated_at", "2019-04-08 09:25:20.243261"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:25:20.266791"], ["updated_at", "2019-04-08 09:25:20.266791"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629120"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 714], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:25:20.278248"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888320"], ["id", 714]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 714]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:25:20.293929"], ["updated_at", "2019-04-08 09:25:20.293929"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801920"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:25:20.300645"], ["updated_at", "2019-04-08 09:25:20.300645"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:25:20.311998"], ["updated_at", "2019-04-08 09:25:20.311998"], ["synced_id", 123]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (1.7ms) BEGIN  (2.0ms) ROLLBACK  (1.9ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.345605"], ["updated_at", "2019-04-08 09:25:20.345605"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.356972"], ["updated_at", "2019-04-08 09:25:20.356972"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Application Load (2.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (1.8ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.379833"], ["updated_at", "2019-04-08 09:25:20.379833"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.401826"], ["updated_at", "2019-04-08 09:25:20.401826"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.407903"], ["updated_at", "2019-04-08 09:25:20.407903"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.412591"], ["updated_at", "2019-04-08 09:25:20.412591"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.416885"], ["updated_at", "2019-04-08 09:25:20.416885"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:25:20.425007"], ["updated_at", "2019-04-08 09:25:20.425007"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:25:20.432336"], ["updated_at", "2019-04-08 09:25:20.432336"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554801920"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:25:20.439806"], ["updated_at", "2019-04-08 09:25:20.439806"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629120"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 771], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:25:20.445106"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888320"], ["id", 771]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 771]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:25:20.458679"], ["updated_at", "2019-04-08 09:25:20.458679"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 772], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:25:20.464617"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 772]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 772], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.476773"], ["updated_at", "2019-04-08 09:25:20.476773"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.483339"], ["updated_at", "2019-04-08 09:25:20.483339"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:25:20.492872"], ["updated_at", "2019-04-08 09:25:20.492872"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.500314"], ["updated_at", "2019-04-08 09:25:20.500314"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.508300"], ["updated_at", "2019-04-08 09:25:20.508300"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.515965"], ["updated_at", "2019-04-08 09:25:20.515965"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.520707"], ["updated_at", "2019-04-08 09:25:20.520707"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.530650"], ["updated_at", "2019-04-08 09:25:20.530650"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.535162"], ["updated_at", "2019-04-08 09:25:20.535162"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 777], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:25:20.543069"], ["id", 777]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.549918"], ["updated_at", "2019-04-08 09:25:20.549918"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.553826"], ["updated_at", "2019-04-08 09:25:20.553826"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 779], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:25:20.561266"], ["id", 779]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 779], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.571995"], ["updated_at", "2019-04-08 09:25:20.571995"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.576303"], ["updated_at", "2019-04-08 09:25:20.576303"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 781], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:25:20.581859"], ["id", 781]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 781], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.590411"], ["updated_at", "2019-04-08 09:25:20.590411"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.594215"], ["updated_at", "2019-04-08 09:25:20.594215"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:25:20.600332"], ["updated_at", "2019-04-08 09:25:20.600332"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:25:20.611745"], ["updated_at", "2019-04-08 09:25:20.611745"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.615576"], ["updated_at", "2019-04-08 09:25:20.615576"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:25:20.624931"], ["updated_at", "2019-04-08 09:25:20.624931"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.629560"], ["updated_at", "2019-04-08 09:25:20.629560"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:25:20.640566"], ["updated_at", "2019-04-08 09:25:20.640566"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:25:20.645109"], ["updated_at", "2019-04-08 09:25:20.645109"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:25:20.674153"], ["updated_at", "2019-04-08 09:25:20.674153"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 5.2ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:25:20.688589"], ["updated_at", "2019-04-08 09:25:20.688589"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:25:20.700113"], ["updated_at", "2019-04-08 09:25:20.700113"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.4ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:25:20.718360"], ["updated_at", "2019-04-08 09:25:20.718360"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.3ms)  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:27:36.425032"], ["updated_at", "2019-04-08 09:27:36.425032"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 36ms (ActiveRecord: 13.4ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:27:36.441474"], ["updated_at", "2019-04-08 09:27:36.441474"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.3ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.6ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:27:36.467439"], ["updated_at", "2019-04-08 09:27:36.467439"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.6ms)  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:27:36.516668"], ["updated_at", "2019-04-08 09:27:36.516668"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 31ms (ActiveRecord: 9.0ms)  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 12ms (Views: 8.6ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.575846"], ["updated_at", "2019-04-08 09:27:36.575846"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.581546"], ["updated_at", "2019-04-08 09:27:36.581546"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 725], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:27:36.589306"], ["id", 725]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 725], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.607921"], ["updated_at", "2019-04-08 09:27:36.607921"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.613128"], ["updated_at", "2019-04-08 09:27:36.613128"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 727], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:27:36.620171"], ["id", 727]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 727], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.629064"], ["updated_at", "2019-04-08 09:27:36.629064"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.634096"], ["updated_at", "2019-04-08 09:27:36.634096"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 729], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:27:36.639527"], ["id", 729]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.647692"], ["updated_at", "2019-04-08 09:27:36.647692"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.652180"], ["updated_at", "2019-04-08 09:27:36.652180"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 731], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:27:36.658328"], ["id", 731]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.665122"], ["updated_at", "2019-04-08 09:27:36.665122"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:27:36.671231"], ["updated_at", "2019-04-08 09:27:36.671231"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.678874"], ["updated_at", "2019-04-08 09:27:36.678874"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:27:36.683768"], ["updated_at", "2019-04-08 09:27:36.683768"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.689893"], ["updated_at", "2019-04-08 09:27:36.689893"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:27:36.694668"], ["updated_at", "2019-04-08 09:27:36.694668"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.701831"], ["updated_at", "2019-04-08 09:27:36.701831"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:27:36.706178"], ["updated_at", "2019-04-08 09:27:36.706178"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:27:36.720834"], ["updated_at", "2019-04-08 09:27:36.720834"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (2.2ms) SAVEPOINT active_record_1 Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:27:36.751214"], ["updated_at", "2019-04-08 09:27:36.751214"]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:27:36.758555"], ["synced_id", 0], ["id", 741]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:27:36.773064"], ["updated_at", "2019-04-08 09:27:36.773064"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:36.780433"], ["updated_at", "2019-04-08 09:27:36.780433"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 743], ["LIMIT", 1]] Account Update (2.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:27:36.791432"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 743]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 743], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:27:36.807629"], ["updated_at", "2019-04-08 09:27:36.807629"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802056"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:27:36.819652"], ["updated_at", "2019-04-08 09:27:36.819652"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629256"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 745], ["LIMIT", 1]] Account Update (2.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:27:36.830591"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888456"], ["id", 745]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 745]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:27:36.846819"], ["updated_at", "2019-04-08 09:27:36.846819"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:27:36.851643"], ["updated_at", "2019-04-08 09:27:36.851643"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:27:36.855996"], ["updated_at", "2019-04-08 09:27:36.855996"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:27:36.866283"], ["updated_at", "2019-04-08 09:27:36.866283"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:27:36.873971"], ["updated_at", "2019-04-08 09:27:36.873971"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:36.892346"], ["updated_at", "2019-04-08 09:27:36.892346"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (1.1ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:27:36.943603"], ["updated_at", "2019-04-08 09:27:36.943603"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.956327"], ["updated_at", "2019-04-08 09:27:36.956327"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.962546"], ["updated_at", "2019-04-08 09:27:36.962546"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:36.974937"], ["updated_at", "2019-04-08 09:27:36.974937"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:36.988820"], ["updated_at", "2019-04-08 09:27:36.988820"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:36.998289"], ["updated_at", "2019-04-08 09:27:36.998289"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:37.007946"], ["updated_at", "2019-04-08 09:27:37.007946"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.014334"], ["updated_at", "2019-04-08 09:27:37.014334"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:37.023383"], ["updated_at", "2019-04-08 09:27:37.023383"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.030331"], ["updated_at", "2019-04-08 09:27:37.030331"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:27:37.039112"], ["updated_at", "2019-04-08 09:27:37.039112"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 800], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:27:37.043156"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 800]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 800], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:27:37.053193"], ["updated_at", "2019-04-08 09:27:37.053193"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802057"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:27:37.060129"], ["updated_at", "2019-04-08 09:27:37.060129"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629257"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 802], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:27:37.065437"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888457"], ["id", 802]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 802]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:27:37.075500"], ["updated_at", "2019-04-08 09:27:37.075500"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:37.083056"], ["updated_at", "2019-04-08 09:27:37.083056"], ["synced_id", 1], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:37.086796"], ["updated_at", "2019-04-08 09:27:37.086796"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:37.090318"], ["updated_at", "2019-04-08 09:27:37.090318"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:27:37.093794"], ["updated_at", "2019-04-08 09:27:37.093794"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.102177"], ["updated_at", "2019-04-08 09:27:37.102177"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.105850"], ["updated_at", "2019-04-08 09:27:37.105850"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 808], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:27:37.111172"], ["id", 808]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.118638"], ["updated_at", "2019-04-08 09:27:37.118638"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.122161"], ["updated_at", "2019-04-08 09:27:37.122161"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 810], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:27:37.127025"], ["id", 810]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 810], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.135426"], ["updated_at", "2019-04-08 09:27:37.135426"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.139352"], ["updated_at", "2019-04-08 09:27:37.139352"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 812], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:27:37.144906"], ["id", 812]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 812], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.153711"], ["updated_at", "2019-04-08 09:27:37.153711"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.157547"], ["updated_at", "2019-04-08 09:27:37.157547"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:27:37.163997"], ["updated_at", "2019-04-08 09:27:37.163997"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:27:37.173842"], ["updated_at", "2019-04-08 09:27:37.173842"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.178357"], ["updated_at", "2019-04-08 09:27:37.178357"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:27:37.186810"], ["updated_at", "2019-04-08 09:27:37.186810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.190566"], ["updated_at", "2019-04-08 09:27:37.190566"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:27:37.198520"], ["updated_at", "2019-04-08 09:27:37.198520"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.202673"], ["updated_at", "2019-04-08 09:27:37.202673"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.209302"], ["updated_at", "2019-04-08 09:27:37.209302"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.213582"], ["updated_at", "2019-04-08 09:27:37.213582"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.221580"], ["updated_at", "2019-04-08 09:27:37.221580"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.257347"], ["updated_at", "2019-04-08 09:27:37.257347"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.272532"], ["updated_at", "2019-04-08 09:27:37.272532"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.286855"], ["updated_at", "2019-04-08 09:27:37.286855"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.301411"], ["updated_at", "2019-04-08 09:27:37.301411"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (3.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.337197"], ["updated_at", "2019-04-08 09:27:37.337197"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:27:37.367655"], ["updated_at", "2019-04-08 09:27:37.367655"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:01.424497"], ["updated_at", "2019-04-08 09:29:01.424497"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 826], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:01.430060"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 826]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 826], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.442072"], ["updated_at", "2019-04-08 09:29:01.442072"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.473858"], ["updated_at", "2019-04-08 09:29:01.473858"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.495490"], ["updated_at", "2019-04-08 09:29:01.495490"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.503927"], ["updated_at", "2019-04-08 09:29:01.503927"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.510453"], ["updated_at", "2019-04-08 09:29:01.510453"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.518129"], ["updated_at", "2019-04-08 09:29:01.518129"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.524722"], ["updated_at", "2019-04-08 09:29:01.524722"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:29:01.541755"], ["updated_at", "2019-04-08 09:29:01.541755"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629341"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 830], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:01.547879"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888541"], ["id", 830]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 830]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:29:01.558862"], ["updated_at", "2019-04-08 09:29:01.558862"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802141"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:01.567230"], ["updated_at", "2019-04-08 09:29:01.567230"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.575755"], ["updated_at", "2019-04-08 09:29:01.575755"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.580534"], ["updated_at", "2019-04-08 09:29:01.580534"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 833], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:01.587416"], ["id", 833]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.595687"], ["updated_at", "2019-04-08 09:29:01.595687"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.599829"], ["updated_at", "2019-04-08 09:29:01.599829"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 835], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:01.605393"], ["id", 835]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 835], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.613719"], ["updated_at", "2019-04-08 09:29:01.613719"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.617859"], ["updated_at", "2019-04-08 09:29:01.617859"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 837], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:01.623465"], ["id", 837]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 837], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.633404"], ["updated_at", "2019-04-08 09:29:01.633404"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.638125"], ["updated_at", "2019-04-08 09:29:01.638125"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:01.647091"], ["updated_at", "2019-04-08 09:29:01.647091"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:01.657530"], ["updated_at", "2019-04-08 09:29:01.657530"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.661664"], ["updated_at", "2019-04-08 09:29:01.661664"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:01.672358"], ["updated_at", "2019-04-08 09:29:01.672358"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.677877"], ["updated_at", "2019-04-08 09:29:01.677877"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:01.687478"], ["updated_at", "2019-04-08 09:29:01.687478"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.692484"], ["updated_at", "2019-04-08 09:29:01.692484"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.700666"], ["updated_at", "2019-04-08 09:29:01.700666"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.704982"], ["updated_at", "2019-04-08 09:29:01.704982"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.713667"], ["updated_at", "2019-04-08 09:29:01.713667"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.718137"], ["updated_at", "2019-04-08 09:29:01.718137"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.722204"], ["updated_at", "2019-04-08 09:29:01.722204"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.726104"], ["updated_at", "2019-04-08 09:29:01.726104"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.734567"], ["updated_at", "2019-04-08 09:29:01.734567"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:01.766417"], ["updated_at", "2019-04-08 09:29:01.766417"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 751], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:01.770370"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 751]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 751], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:01.779710"], ["updated_at", "2019-04-08 09:29:01.779710"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:29:01.789744"], ["updated_at", "2019-04-08 09:29:01.789744"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:29:01.792987"], ["synced_id", 0], ["id", 753]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:01.805067"], ["updated_at", "2019-04-08 09:29:01.805067"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:01.834112"], ["updated_at", "2019-04-08 09:29:01.834112"], ["synced_id", 1]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:01.840863"], ["updated_at", "2019-04-08 09:29:01.840863"], ["synced_id", 2]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:01.848508"], ["updated_at", "2019-04-08 09:29:01.848508"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:01.860800"], ["updated_at", "2019-04-08 09:29:01.860800"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802141"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:01.868706"], ["updated_at", "2019-04-08 09:29:01.868706"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629341"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 759], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:01.873792"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888541"], ["id", 759]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (2.1ms) SAVEPOINT active_record_1 Account Destroy (2.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 759]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.8ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.898235"], ["updated_at", "2019-04-08 09:29:01.898235"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:01.907325"], ["updated_at", "2019-04-08 09:29:01.907325"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.921371"], ["updated_at", "2019-04-08 09:29:01.921371"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:01.934828"], ["updated_at", "2019-04-08 09:29:01.934828"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.951228"], ["updated_at", "2019-04-08 09:29:01.951228"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (2.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:01.966643"], ["updated_at", "2019-04-08 09:29:01.966643"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.978521"], ["updated_at", "2019-04-08 09:29:01.978521"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:01.986160"], ["updated_at", "2019-04-08 09:29:01.986160"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:01.997896"], ["updated_at", "2019-04-08 09:29:01.997896"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.002921"], ["updated_at", "2019-04-08 09:29:02.002921"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 769], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:02.010429"], ["id", 769]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 769], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.020884"], ["updated_at", "2019-04-08 09:29:02.020884"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.025966"], ["updated_at", "2019-04-08 09:29:02.025966"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 771], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:02.032206"], ["id", 771]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 771], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.041439"], ["updated_at", "2019-04-08 09:29:02.041439"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.046007"], ["updated_at", "2019-04-08 09:29:02.046007"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 773], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:02.051610"], ["id", 773]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.059372"], ["updated_at", "2019-04-08 09:29:02.059372"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.064130"], ["updated_at", "2019-04-08 09:29:02.064130"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 775], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:02.069449"], ["id", 775]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:02.085470"], ["updated_at", "2019-04-08 09:29:02.085470"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:02.095685"], ["updated_at", "2019-04-08 09:29:02.095685"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:02.123151"], ["updated_at", "2019-04-08 09:29:02.123151"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:02.173066"], ["updated_at", "2019-04-08 09:29:02.173066"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.184868"], ["updated_at", "2019-04-08 09:29:02.184868"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:02.190019"], ["updated_at", "2019-04-08 09:29:02.190019"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:02.203496"], ["updated_at", "2019-04-08 09:29:02.203496"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:02.220900"], ["updated_at", "2019-04-08 09:29:02.220900"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:02.247339"], ["updated_at", "2019-04-08 09:29:02.247339"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:02.269903"], ["updated_at", "2019-04-08 09:29:02.269903"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:02.290616"], ["updated_at", "2019-04-08 09:29:02.290616"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (6.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:02.317507"], ["updated_at", "2019-04-08 09:29:02.317507"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:02.389184"], ["updated_at", "2019-04-08 09:29:02.389184"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.6ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:02.402545"], ["updated_at", "2019-04-08 09:29:02.402545"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:02.416754"], ["updated_at", "2019-04-08 09:29:02.416754"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:02.436289"], ["updated_at", "2019-04-08 09:29:02.436289"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 4.8ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:19.975933"], ["updated_at", "2019-04-08 09:29:19.975933"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.002274"], ["updated_at", "2019-04-08 09:29:20.002274"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.009795"], ["updated_at", "2019-04-08 09:29:20.009795"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.023522"], ["updated_at", "2019-04-08 09:29:20.023522"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.027977"], ["updated_at", "2019-04-08 09:29:20.027977"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 862], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:20.036671"], ["id", 862]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.046061"], ["updated_at", "2019-04-08 09:29:20.046061"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.050099"], ["updated_at", "2019-04-08 09:29:20.050099"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 864], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:20.056336"], ["id", 864]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 864], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.076227"], ["updated_at", "2019-04-08 09:29:20.076227"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.083319"], ["updated_at", "2019-04-08 09:29:20.083319"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 866], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:20.090870"], ["id", 866]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 866], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.100399"], ["updated_at", "2019-04-08 09:29:20.100399"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.105038"], ["updated_at", "2019-04-08 09:29:20.105038"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:20.116071"], ["updated_at", "2019-04-08 09:29:20.116071"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.1ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:20.130264"], ["updated_at", "2019-04-08 09:29:20.130264"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.135612"], ["updated_at", "2019-04-08 09:29:20.135612"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:20.145276"], ["updated_at", "2019-04-08 09:29:20.145276"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.149805"], ["updated_at", "2019-04-08 09:29:20.149805"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:20.159784"], ["updated_at", "2019-04-08 09:29:20.159784"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.163876"], ["updated_at", "2019-04-08 09:29:20.163876"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.171360"], ["updated_at", "2019-04-08 09:29:20.171360"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.178458"], ["updated_at", "2019-04-08 09:29:20.178458"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.189518"], ["updated_at", "2019-04-08 09:29:20.189518"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.216091"], ["updated_at", "2019-04-08 09:29:20.216091"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.225220"], ["updated_at", "2019-04-08 09:29:20.225220"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.232089"], ["updated_at", "2019-04-08 09:29:20.232089"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.241549"], ["updated_at", "2019-04-08 09:29:20.241549"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.246213"], ["updated_at", "2019-04-08 09:29:20.246213"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.250268"], ["updated_at", "2019-04-08 09:29:20.250268"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.254392"], ["updated_at", "2019-04-08 09:29:20.254392"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.263681"], ["updated_at", "2019-04-08 09:29:20.263681"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.269141"], ["updated_at", "2019-04-08 09:29:20.269141"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:20.277547"], ["updated_at", "2019-04-08 09:29:20.277547"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 885], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:20.281884"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 885]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 885], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:29:20.291310"], ["updated_at", "2019-04-08 09:29:20.291310"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802160"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:29:20.299400"], ["updated_at", "2019-04-08 09:29:20.299400"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629360"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 887], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:20.304409"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888560"], ["id", 887]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 887]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.319095"], ["updated_at", "2019-04-08 09:29:20.319095"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.344749"], ["updated_at", "2019-04-08 09:29:20.344749"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.362700"], ["updated_at", "2019-04-08 09:29:20.362700"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.394187"], ["updated_at", "2019-04-08 09:29:20.394187"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.414917"], ["updated_at", "2019-04-08 09:29:20.414917"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.444528"], ["updated_at", "2019-04-08 09:29:20.444528"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 12ms (Views: 9.1ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:20.538817"], ["updated_at", "2019-04-08 09:29:20.538817"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 31ms (ActiveRecord: 10.7ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:20.551345"], ["updated_at", "2019-04-08 09:29:20.551345"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:20.563160"], ["updated_at", "2019-04-08 09:29:20.563160"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.2ms)  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:20.579477"], ["updated_at", "2019-04-08 09:29:20.579477"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.0ms)  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:20.613258"], ["updated_at", "2019-04-08 09:29:20.613258"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.626574"], ["updated_at", "2019-04-08 09:29:20.626574"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.631837"], ["updated_at", "2019-04-08 09:29:20.631837"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.644905"], ["updated_at", "2019-04-08 09:29:20.644905"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.649353"], ["updated_at", "2019-04-08 09:29:20.649353"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 786], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:20.654380"], ["id", 786]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.661816"], ["updated_at", "2019-04-08 09:29:20.661816"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.665758"], ["updated_at", "2019-04-08 09:29:20.665758"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 788], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:20.670608"], ["id", 788]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 788], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.679488"], ["updated_at", "2019-04-08 09:29:20.679488"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.683462"], ["updated_at", "2019-04-08 09:29:20.683462"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 790], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:20.688490"], ["id", 790]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 790], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.696565"], ["updated_at", "2019-04-08 09:29:20.696565"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.704011"], ["updated_at", "2019-04-08 09:29:20.704011"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 792], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:20.709910"], ["id", 792]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.717459"], ["updated_at", "2019-04-08 09:29:20.717459"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:20.725316"], ["updated_at", "2019-04-08 09:29:20.725316"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "accounts"  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.740694"], ["updated_at", "2019-04-08 09:29:20.740694"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:20.749345"], ["updated_at", "2019-04-08 09:29:20.749345"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.758363"], ["updated_at", "2019-04-08 09:29:20.758363"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:20.765683"], ["updated_at", "2019-04-08 09:29:20.765683"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:20.775179"], ["updated_at", "2019-04-08 09:29:20.775179"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:20.782148"], ["updated_at", "2019-04-08 09:29:20.782148"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:20.790972"], ["updated_at", "2019-04-08 09:29:20.790972"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:20.799998"], ["updated_at", "2019-04-08 09:29:20.799998"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:20.808773"], ["updated_at", "2019-04-08 09:29:20.808773"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802160"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:20.817832"], ["updated_at", "2019-04-08 09:29:20.817832"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629360"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 804], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:20.823765"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888560"], ["id", 804]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 804]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.836104"], ["updated_at", "2019-04-08 09:29:20.836104"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 805], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:20.841023"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 805]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 805], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:20.850014"], ["updated_at", "2019-04-08 09:29:20.850014"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:20.879337"], ["updated_at", "2019-04-08 09:29:20.879337"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:20.890394"], ["updated_at", "2019-04-08 09:29:20.890394"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:20.894516"], ["updated_at", "2019-04-08 09:29:20.894516"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:20.898542"], ["updated_at", "2019-04-08 09:29:20.898542"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.9ms) SAVEPOINT active_record_1 Account Create (2.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:29:20.912962"], ["updated_at", "2019-04-08 09:29:20.912962"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Update (1.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:29:20.920759"], ["synced_id", 0], ["id", 810]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:20.966128"], ["updated_at", "2019-04-08 09:29:20.966128"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:49.179791"], ["updated_at", "2019-04-08 09:29:49.179791"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.209661"], ["updated_at", "2019-04-08 09:29:49.209661"], ["synced_id", 123], ["host", "example.host"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.219580"], ["updated_at", "2019-04-08 09:29:49.219580"], ["synced_id", 123], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.239750"], ["updated_at", "2019-04-08 09:29:49.239750"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.246058"], ["updated_at", "2019-04-08 09:29:49.246058"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:49.258895"], ["updated_at", "2019-04-08 09:29:49.258895"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:49.272475"], ["updated_at", "2019-04-08 09:29:49.272475"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.277323"], ["updated_at", "2019-04-08 09:29:49.277323"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:49.286304"], ["updated_at", "2019-04-08 09:29:49.286304"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.291395"], ["updated_at", "2019-04-08 09:29:49.291395"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:49.300207"], ["updated_at", "2019-04-08 09:29:49.300207"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.304526"], ["updated_at", "2019-04-08 09:29:49.304526"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.312458"], ["updated_at", "2019-04-08 09:29:49.312458"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.317132"], ["updated_at", "2019-04-08 09:29:49.317132"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 903], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:49.322115"], ["id", 903]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.328708"], ["updated_at", "2019-04-08 09:29:49.328708"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.333507"], ["updated_at", "2019-04-08 09:29:49.333507"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 905], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:49.339071"], ["id", 905]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 905], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.347961"], ["updated_at", "2019-04-08 09:29:49.347961"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.351948"], ["updated_at", "2019-04-08 09:29:49.351948"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 907], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:49.357513"], ["id", 907]]  (1.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 907], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.370100"], ["updated_at", "2019-04-08 09:29:49.370100"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.376161"], ["updated_at", "2019-04-08 09:29:49.376161"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:29:49.394371"], ["updated_at", "2019-04-08 09:29:49.394371"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629389"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 911], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:49.400830"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888589"], ["id", 911]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 911]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:29:49.411979"], ["updated_at", "2019-04-08 09:29:49.411979"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802189"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.421428"], ["updated_at", "2019-04-08 09:29:49.421428"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.426290"], ["updated_at", "2019-04-08 09:29:49.426290"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.430680"], ["updated_at", "2019-04-08 09:29:49.430680"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.435539"], ["updated_at", "2019-04-08 09:29:49.435539"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.445002"], ["updated_at", "2019-04-08 09:29:49.445002"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.467791"], ["updated_at", "2019-04-08 09:29:49.467791"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.488273"], ["updated_at", "2019-04-08 09:29:49.488273"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:49.500808"], ["updated_at", "2019-04-08 09:29:49.500808"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:49.508652"], ["updated_at", "2019-04-08 09:29:49.508652"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 920], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:49.512638"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 920]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 920], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.521425"], ["updated_at", "2019-04-08 09:29:49.521425"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.528859"], ["updated_at", "2019-04-08 09:29:49.528859"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.534386"], ["updated_at", "2019-04-08 09:29:49.534386"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.542453"], ["updated_at", "2019-04-08 09:29:49.542453"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.548931"], ["updated_at", "2019-04-08 09:29:49.548931"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.559465"], ["updated_at", "2019-04-08 09:29:49.559465"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:49.623543"], ["updated_at", "2019-04-08 09:29:49.623543"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 4.7ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:49.636640"], ["updated_at", "2019-04-08 09:29:49.636640"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.4ms)  (1.1ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:49.648140"], ["updated_at", "2019-04-08 09:29:49.648140"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 2.9ms)  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:29:49.661511"], ["updated_at", "2019-04-08 09:29:49.661511"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.5ms)  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.684669"], ["updated_at", "2019-04-08 09:29:49.684669"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.707256"], ["updated_at", "2019-04-08 09:29:49.707256"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.733320"], ["updated_at", "2019-04-08 09:29:49.733320"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.754085"], ["updated_at", "2019-04-08 09:29:49.754085"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.769285"], ["updated_at", "2019-04-08 09:29:49.769285"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:49.784104"], ["updated_at", "2019-04-08 09:29:49.784104"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.802788"], ["updated_at", "2019-04-08 09:29:49.802788"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.806820"], ["updated_at", "2019-04-08 09:29:49.806820"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 816], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:49.811630"], ["id", 816]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.817733"], ["updated_at", "2019-04-08 09:29:49.817733"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.821153"], ["updated_at", "2019-04-08 09:29:49.821153"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 818], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:49.826524"], ["id", 818]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.833379"], ["updated_at", "2019-04-08 09:29:49.833379"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.837020"], ["updated_at", "2019-04-08 09:29:49.837020"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 820], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:49.842529"], ["id", 820]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 820], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.851018"], ["updated_at", "2019-04-08 09:29:49.851018"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.854526"], ["updated_at", "2019-04-08 09:29:49.854526"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 822], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:29:49.860245"], ["id", 822]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 822], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.869130"], ["updated_at", "2019-04-08 09:29:49.869130"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:49.877263"], ["updated_at", "2019-04-08 09:29:49.877263"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.885579"], ["updated_at", "2019-04-08 09:29:49.885579"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:49.891159"], ["updated_at", "2019-04-08 09:29:49.891159"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.898467"], ["updated_at", "2019-04-08 09:29:49.898467"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:49.903263"], ["updated_at", "2019-04-08 09:29:49.903263"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:29:49.910129"], ["updated_at", "2019-04-08 09:29:49.910129"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:29:49.915618"], ["updated_at", "2019-04-08 09:29:49.915618"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:49.922330"], ["updated_at", "2019-04-08 09:29:49.922330"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:49.929659"], ["updated_at", "2019-04-08 09:29:49.929659"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:29:49.941482"], ["updated_at", "2019-04-08 09:29:49.941482"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:29:49.944801"], ["synced_id", 0], ["id", 833]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:49.956301"], ["updated_at", "2019-04-08 09:29:49.956301"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:49.960842"], ["updated_at", "2019-04-08 09:29:49.960842"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:49.965405"], ["updated_at", "2019-04-08 09:29:49.965405"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:49.978131"], ["updated_at", "2019-04-08 09:29:49.978131"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:49.987459"], ["updated_at", "2019-04-08 09:29:49.987459"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629389"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 837], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:49.994057"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888589"], ["id", 837]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 837]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:29:50.006757"], ["updated_at", "2019-04-08 09:29:50.006757"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802190"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:29:50.015213"], ["updated_at", "2019-04-08 09:29:50.015213"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:29:50.041582"], ["updated_at", "2019-04-08 09:29:50.041582"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 840], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:29:50.045034"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 840]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 840], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.4ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.205123"], ["updated_at", "2019-04-08 09:31:00.205123"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.226961"], ["updated_at", "2019-04-08 09:31:00.226961"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.4ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.252162"], ["updated_at", "2019-04-08 09:31:00.252162"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.262534"], ["updated_at", "2019-04-08 09:31:00.262534"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.271361"], ["updated_at", "2019-04-08 09:31:00.271361"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.274444"], ["updated_at", "2019-04-08 09:31:00.274444"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 927], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:31:00.279367"], ["id", 927]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.288976"], ["updated_at", "2019-04-08 09:31:00.288976"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.294176"], ["updated_at", "2019-04-08 09:31:00.294176"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 929], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:31:00.301679"], ["id", 929]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 929], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.312742"], ["updated_at", "2019-04-08 09:31:00.312742"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.316524"], ["updated_at", "2019-04-08 09:31:00.316524"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 931], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:31:00.321381"], ["id", 931]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 931], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.329375"], ["updated_at", "2019-04-08 09:31:00.329375"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.334221"], ["updated_at", "2019-04-08 09:31:00.334221"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:31:00.349459"], ["updated_at", "2019-04-08 09:31:00.349459"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:31:00.362576"], ["updated_at", "2019-04-08 09:31:00.362576"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.366631"], ["updated_at", "2019-04-08 09:31:00.366631"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:31:00.377725"], ["updated_at", "2019-04-08 09:31:00.377725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.382312"], ["updated_at", "2019-04-08 09:31:00.382312"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:31:00.394552"], ["updated_at", "2019-04-08 09:31:00.394552"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.398993"], ["updated_at", "2019-04-08 09:31:00.398993"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.406329"], ["updated_at", "2019-04-08 09:31:00.406329"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.412247"], ["updated_at", "2019-04-08 09:31:00.412247"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:31:00.422497"], ["updated_at", "2019-04-08 09:31:00.422497"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.430119"], ["updated_at", "2019-04-08 09:31:00.430119"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.439009"], ["updated_at", "2019-04-08 09:31:00.439009"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.447513"], ["updated_at", "2019-04-08 09:31:00.447513"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.456144"], ["updated_at", "2019-04-08 09:31:00.456144"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:31:00.479185"], ["updated_at", "2019-04-08 09:31:00.479185"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802260"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:31:00.490926"], ["updated_at", "2019-04-08 09:31:00.490926"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629460"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 948], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:31:00.498974"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888660"], ["id", 948]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.2ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 948]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:31:00.516043"], ["updated_at", "2019-04-08 09:31:00.516043"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 949], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:31:00.522102"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 949]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 949], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.535228"], ["updated_at", "2019-04-08 09:31:00.535228"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.541567"], ["updated_at", "2019-04-08 09:31:00.541567"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.547416"], ["updated_at", "2019-04-08 09:31:00.547416"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.553866"], ["updated_at", "2019-04-08 09:31:00.553866"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:31:00.596608"], ["updated_at", "2019-04-08 09:31:00.596608"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 22ms (ActiveRecord: 9.9ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:31:00.611708"], ["updated_at", "2019-04-08 09:31:00.611708"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:31:00.627483"], ["updated_at", "2019-04-08 09:31:00.627483"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.4ms)  (1.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:31:00.653004"], ["updated_at", "2019-04-08 09:31:00.653004"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.5ms)  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 7.9ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:00.721179"], ["updated_at", "2019-04-08 09:31:00.721179"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 844], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:31:00.726063"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 844]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 844], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:31:00.736942"], ["updated_at", "2019-04-08 09:31:00.736942"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629460"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 845], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:31:00.742067"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888660"], ["id", 845]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 845]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:31:00.757923"], ["updated_at", "2019-04-08 09:31:00.757923"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802260"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:31:00.766249"], ["updated_at", "2019-04-08 09:31:00.766249"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:31:00.791140"], ["updated_at", "2019-04-08 09:31:00.791140"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:31:00.798294"], ["updated_at", "2019-04-08 09:31:00.798294"], ["synced_id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:31:00.805837"], ["updated_at", "2019-04-08 09:31:00.805837"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:31:00.811077"], ["updated_at", "2019-04-08 09:31:00.811077"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:31:00.822530"], ["updated_at", "2019-04-08 09:31:00.822530"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:31:00.825731"], ["synced_id", 0], ["id", 852]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:31:00.835330"], ["updated_at", "2019-04-08 09:31:00.835330"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (1.7ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:31:00.852788"], ["updated_at", "2019-04-08 09:31:00.852788"], ["synced_id", 123]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (2.2ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Account Exists (3.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.874335"], ["updated_at", "2019-04-08 09:31:00.874335"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 Account Exists (3.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.887686"], ["updated_at", "2019-04-08 09:31:00.887686"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 855], ["LIMIT", 1]] Account Update (3.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:31:00.902564"], ["id", 855]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.925367"], ["updated_at", "2019-04-08 09:31:00.925367"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.931351"], ["updated_at", "2019-04-08 09:31:00.931351"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 857], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:31:00.939041"], ["id", 857]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.947467"], ["updated_at", "2019-04-08 09:31:00.947467"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.952313"], ["updated_at", "2019-04-08 09:31:00.952313"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 859], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:31:00.958544"], ["id", 859]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 859], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.968341"], ["updated_at", "2019-04-08 09:31:00.968341"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:00.973878"], ["updated_at", "2019-04-08 09:31:00.973878"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 861], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:31:00.981549"], ["id", 861]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 861], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:01.007039"], ["updated_at", "2019-04-08 09:31:01.007039"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:31:01.016614"], ["updated_at", "2019-04-08 09:31:01.016614"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:01.025999"], ["updated_at", "2019-04-08 09:31:01.025999"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:31:01.031529"], ["updated_at", "2019-04-08 09:31:01.031529"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:01.039904"], ["updated_at", "2019-04-08 09:31:01.039904"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:31:01.045437"], ["updated_at", "2019-04-08 09:31:01.045437"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:01.054169"], ["updated_at", "2019-04-08 09:31:01.054169"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:31:01.060438"], ["updated_at", "2019-04-08 09:31:01.060438"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:01.074296"], ["updated_at", "2019-04-08 09:31:01.074296"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:01.091584"], ["updated_at", "2019-04-08 09:31:01.091584"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:01.112369"], ["updated_at", "2019-04-08 09:31:01.112369"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:01.126472"], ["updated_at", "2019-04-08 09:31:01.126472"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:01.149362"], ["updated_at", "2019-04-08 09:31:01.149362"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:01.165683"], ["updated_at", "2019-04-08 09:31:01.165683"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:31:01.190008"], ["updated_at", "2019-04-08 09:31:01.190008"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:01.198926"], ["updated_at", "2019-04-08 09:31:01.198926"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:31:01.204095"], ["updated_at", "2019-04-08 09:31:01.204095"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:31:01.247158"], ["updated_at", "2019-04-08 09:31:01.247158"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:57.664323"], ["updated_at", "2019-04-08 09:33:57.664323"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:57.703509"], ["updated_at", "2019-04-08 09:33:57.703509"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:57.724143"], ["updated_at", "2019-04-08 09:33:57.724143"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:57.751791"], ["updated_at", "2019-04-08 09:33:57.751791"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:57.770625"], ["updated_at", "2019-04-08 09:33:57.770625"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:57.794222"], ["updated_at", "2019-04-08 09:33:57.794222"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:33:57.896066"], ["updated_at", "2019-04-08 09:33:57.896066"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 23ms (ActiveRecord: 11.4ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:33:57.908785"], ["updated_at", "2019-04-08 09:33:57.908785"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:33:57.921821"], ["updated_at", "2019-04-08 09:33:57.921821"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 3.2ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:33:57.955237"], ["updated_at", "2019-04-08 09:33:57.955237"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 25ms (ActiveRecord: 6.3ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:57.986553"], ["updated_at", "2019-04-08 09:33:57.986553"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:33:58.001824"], ["updated_at", "2019-04-08 09:33:58.001824"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629637"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 959], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:33:58.009912"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888838"], ["id", 959]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.3ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 959]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:33:58.026349"], ["updated_at", "2019-04-08 09:33:58.026349"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802438"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.035891"], ["updated_at", "2019-04-08 09:33:58.035891"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.040572"], ["updated_at", "2019-04-08 09:33:58.040572"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 961], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:33:58.046411"], ["id", 961]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.054921"], ["updated_at", "2019-04-08 09:33:58.054921"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.060664"], ["updated_at", "2019-04-08 09:33:58.060664"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 963], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:33:58.068490"], ["id", 963]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 963], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.078801"], ["updated_at", "2019-04-08 09:33:58.078801"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.083720"], ["updated_at", "2019-04-08 09:33:58.083720"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 965], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:33:58.090002"], ["id", 965]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 965], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.099332"], ["updated_at", "2019-04-08 09:33:58.099332"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.104430"], ["updated_at", "2019-04-08 09:33:58.104430"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:33:58.112385"], ["updated_at", "2019-04-08 09:33:58.112385"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.2ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:33:58.129457"], ["updated_at", "2019-04-08 09:33:58.129457"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.135562"], ["updated_at", "2019-04-08 09:33:58.135562"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:33:58.146752"], ["updated_at", "2019-04-08 09:33:58.146752"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.151935"], ["updated_at", "2019-04-08 09:33:58.151935"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:33:58.171379"], ["updated_at", "2019-04-08 09:33:58.171379"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.177525"], ["updated_at", "2019-04-08 09:33:58.177525"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.189014"], ["updated_at", "2019-04-08 09:33:58.189014"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.194227"], ["updated_at", "2019-04-08 09:33:58.194227"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:33:58.204177"], ["updated_at", "2019-04-08 09:33:58.204177"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 978], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:33:58.209535"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 978]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 978], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.218284"], ["updated_at", "2019-04-08 09:33:58.218284"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.225965"], ["updated_at", "2019-04-08 09:33:58.225965"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.232398"], ["updated_at", "2019-04-08 09:33:58.232398"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.240533"], ["updated_at", "2019-04-08 09:33:58.240533"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.244753"], ["updated_at", "2019-04-08 09:33:58.244753"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.248355"], ["updated_at", "2019-04-08 09:33:58.248355"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.251805"], ["updated_at", "2019-04-08 09:33:58.251805"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.260079"], ["updated_at", "2019-04-08 09:33:58.260079"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.285304"], ["updated_at", "2019-04-08 09:33:58.285304"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.294926"], ["updated_at", "2019-04-08 09:33:58.294926"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:33:58.307667"], ["updated_at", "2019-04-08 09:33:58.307667"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.315832"], ["updated_at", "2019-04-08 09:33:58.315832"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.323273"], ["updated_at", "2019-04-08 09:33:58.323273"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:33:58.336957"], ["updated_at", "2019-04-08 09:33:58.336957"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.360902"], ["updated_at", "2019-04-08 09:33:58.360902"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.368733"], ["updated_at", "2019-04-08 09:33:58.368733"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.4ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:33:58.386496"], ["updated_at", "2019-04-08 09:33:58.386496"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:33:58.389688"], ["synced_id", 0], ["id", 875]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:33:58.402601"], ["updated_at", "2019-04-08 09:33:58.402601"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.411568"], ["updated_at", "2019-04-08 09:33:58.411568"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:33:58.417894"], ["updated_at", "2019-04-08 09:33:58.417894"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.428136"], ["updated_at", "2019-04-08 09:33:58.428136"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:33:58.433338"], ["updated_at", "2019-04-08 09:33:58.433338"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.442179"], ["updated_at", "2019-04-08 09:33:58.442179"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:33:58.447834"], ["updated_at", "2019-04-08 09:33:58.447834"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.456045"], ["updated_at", "2019-04-08 09:33:58.456045"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:33:58.462845"], ["updated_at", "2019-04-08 09:33:58.462845"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.471470"], ["updated_at", "2019-04-08 09:33:58.471470"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.477094"], ["updated_at", "2019-04-08 09:33:58.477094"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 886], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:33:58.482963"], ["id", 886]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 886], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.492575"], ["updated_at", "2019-04-08 09:33:58.492575"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.496110"], ["updated_at", "2019-04-08 09:33:58.496110"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 888], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:33:58.500147"], ["id", 888]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 888], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.507719"], ["updated_at", "2019-04-08 09:33:58.507719"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.511153"], ["updated_at", "2019-04-08 09:33:58.511153"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 890], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:33:58.515644"], ["id", 890]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.523733"], ["updated_at", "2019-04-08 09:33:58.523733"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:33:58.529203"], ["updated_at", "2019-04-08 09:33:58.529203"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 892], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:33:58.534665"], ["id", 892]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:33:58.543743"], ["updated_at", "2019-04-08 09:33:58.543743"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:33:58.551107"], ["updated_at", "2019-04-08 09:33:58.551107"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:33:58.559536"], ["updated_at", "2019-04-08 09:33:58.559536"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:33:58.563392"], ["updated_at", "2019-04-08 09:33:58.563392"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:33:58.568124"], ["updated_at", "2019-04-08 09:33:58.568124"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:33:58.577240"], ["updated_at", "2019-04-08 09:33:58.577240"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802438"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:33:58.584376"], ["updated_at", "2019-04-08 09:33:58.584376"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629638"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 898], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:33:58.590272"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888838"], ["id", 898]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 898]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:33:58.601213"], ["updated_at", "2019-04-08 09:33:58.601213"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (2.7ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:33:58.635205"], ["updated_at", "2019-04-08 09:33:58.635205"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 900], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:33:58.639891"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 900]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 900], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (2.2ms) ROLLBACK  (2.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (2.1ms) ROLLBACK  (1.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (1.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.050941"], ["updated_at", "2019-04-08 09:36:31.050941"], ["synced_id", 123], ["host", "example.host"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.059372"], ["updated_at", "2019-04-08 09:36:31.059372"], ["synced_id", 123], ["host", "test.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:36:31.084948"], ["updated_at", "2019-04-08 09:36:31.084948"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.094811"], ["updated_at", "2019-04-08 09:36:31.094811"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:36:31.105969"], ["updated_at", "2019-04-08 09:36:31.105969"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "accounts"  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.116465"], ["updated_at", "2019-04-08 09:36:31.116465"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:36:31.121856"], ["updated_at", "2019-04-08 09:36:31.121856"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.133382"], ["updated_at", "2019-04-08 09:36:31.133382"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:36:31.141895"], ["updated_at", "2019-04-08 09:36:31.141895"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.4ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.155783"], ["updated_at", "2019-04-08 09:36:31.155783"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:36:31.163375"], ["updated_at", "2019-04-08 09:36:31.163375"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.171822"], ["updated_at", "2019-04-08 09:36:31.171822"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.175774"], ["updated_at", "2019-04-08 09:36:31.175774"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 911], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:36:31.182772"], ["id", 911]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.194207"], ["updated_at", "2019-04-08 09:36:31.194207"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.201392"], ["updated_at", "2019-04-08 09:36:31.201392"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 913], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:36:31.208960"], ["id", 913]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.217338"], ["updated_at", "2019-04-08 09:36:31.217338"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.222140"], ["updated_at", "2019-04-08 09:36:31.222140"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 915], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:36:31.228065"], ["id", 915]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 915], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.238158"], ["updated_at", "2019-04-08 09:36:31.238158"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.242545"], ["updated_at", "2019-04-08 09:36:31.242545"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 917], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:36:31.247952"], ["id", 917]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 917], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:36:31.278454"], ["updated_at", "2019-04-08 09:36:31.278454"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:36:31.282830"], ["synced_id", 0], ["id", 918]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.299385"], ["updated_at", "2019-04-08 09:36:31.299385"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 919], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:36:31.303780"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 919]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 919], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:36:31.311438"], ["updated_at", "2019-04-08 09:36:31.311438"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:36:31.316171"], ["updated_at", "2019-04-08 09:36:31.316171"], ["synced_id", 2]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:36:31.320181"], ["updated_at", "2019-04-08 09:36:31.320181"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:36:31.328566"], ["updated_at", "2019-04-08 09:36:31.328566"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:36:31.374648"], ["updated_at", "2019-04-08 09:36:31.374648"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802591"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:36:31.381594"], ["updated_at", "2019-04-08 09:36:31.381594"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629791"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 925], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:36:31.386609"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888991"], ["id", 925]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 925]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:36:31.398833"], ["updated_at", "2019-04-08 09:36:31.398833"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:36:31.405880"], ["updated_at", "2019-04-08 09:36:31.405880"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:36:31.414147"], ["updated_at", "2019-04-08 09:36:31.414147"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 6.4ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:36:31.450067"], ["updated_at", "2019-04-08 09:36:31.450067"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 5.6ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:36:31.465156"], ["updated_at", "2019-04-08 09:36:31.465156"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:36:31.480367"], ["updated_at", "2019-04-08 09:36:31.480367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 4.8ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:36:31.499807"], ["updated_at", "2019-04-08 09:36:31.499807"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:36:31.523505"], ["updated_at", "2019-04-08 09:36:31.523505"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 995], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:36:31.529460"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 995]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 995], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:36:31.540026"], ["updated_at", "2019-04-08 09:36:31.540026"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.548431"], ["updated_at", "2019-04-08 09:36:31.548431"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.553088"], ["updated_at", "2019-04-08 09:36:31.553088"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.557478"], ["updated_at", "2019-04-08 09:36:31.557478"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.562993"], ["updated_at", "2019-04-08 09:36:31.562993"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.571761"], ["updated_at", "2019-04-08 09:36:31.571761"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.592070"], ["updated_at", "2019-04-08 09:36:31.592070"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.597360"], ["updated_at", "2019-04-08 09:36:31.597360"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1002], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:36:31.604012"], ["id", 1002]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.613281"], ["updated_at", "2019-04-08 09:36:31.613281"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.619007"], ["updated_at", "2019-04-08 09:36:31.619007"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1004], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:36:31.625329"], ["id", 1004]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1004], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.633754"], ["updated_at", "2019-04-08 09:36:31.633754"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.637418"], ["updated_at", "2019-04-08 09:36:31.637418"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1006], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:36:31.642504"], ["id", 1006]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1006], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.650864"], ["updated_at", "2019-04-08 09:36:31.650864"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.654545"], ["updated_at", "2019-04-08 09:36:31.654545"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:36:31.661605"], ["updated_at", "2019-04-08 09:36:31.661605"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:36:31.670677"], ["updated_at", "2019-04-08 09:36:31.670677"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.674604"], ["updated_at", "2019-04-08 09:36:31.674604"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:36:31.683778"], ["updated_at", "2019-04-08 09:36:31.683778"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.687995"], ["updated_at", "2019-04-08 09:36:31.687995"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:36:31.699021"], ["updated_at", "2019-04-08 09:36:31.699021"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.703355"], ["updated_at", "2019-04-08 09:36:31.703355"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.712024"], ["updated_at", "2019-04-08 09:36:31.712024"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.716395"], ["updated_at", "2019-04-08 09:36:31.716395"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.725866"], ["updated_at", "2019-04-08 09:36:31.725866"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.733503"], ["updated_at", "2019-04-08 09:36:31.733503"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.744384"], ["updated_at", "2019-04-08 09:36:31.744384"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.756742"], ["updated_at", "2019-04-08 09:36:31.756742"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:36:31.766557"], ["updated_at", "2019-04-08 09:36:31.766557"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629791"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1021], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:36:31.771409"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554888991"], ["id", 1021]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1021]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:36:31.781202"], ["updated_at", "2019-04-08 09:36:31.781202"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802591"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:36:31.788370"], ["updated_at", "2019-04-08 09:36:31.788370"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.795312"], ["updated_at", "2019-04-08 09:36:31.795312"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.801133"], ["updated_at", "2019-04-08 09:36:31.801133"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 9ms (Views: 7.9ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.867318"], ["updated_at", "2019-04-08 09:36:31.867318"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.879873"], ["updated_at", "2019-04-08 09:36:31.879873"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.897583"], ["updated_at", "2019-04-08 09:36:31.897583"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.920775"], ["updated_at", "2019-04-08 09:36:31.920775"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.951696"], ["updated_at", "2019-04-08 09:36:31.951696"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.975237"], ["updated_at", "2019-04-08 09:36:31.975237"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:36:31.999025"], ["updated_at", "2019-04-08 09:36:31.999025"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:13.416340"], ["updated_at", "2019-04-08 09:39:13.416340"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:13.445551"], ["updated_at", "2019-04-08 09:39:13.445551"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:13.469937"], ["updated_at", "2019-04-08 09:39:13.469937"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:13.502214"], ["updated_at", "2019-04-08 09:39:13.502214"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.6ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:13.523028"], ["updated_at", "2019-04-08 09:39:13.523028"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:13.549967"], ["updated_at", "2019-04-08 09:39:13.549967"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.623098"], ["updated_at", "2019-04-08 09:39:13.623098"], ["synced_id", 123], ["host", "example.host"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.632966"], ["updated_at", "2019-04-08 09:39:13.632966"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:39:13.679607"], ["updated_at", "2019-04-08 09:39:13.679607"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.6ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.4ms) ROLLBACK  (2.1ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:39:13.728771"], ["updated_at", "2019-04-08 09:39:13.728771"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:39:13.752920"], ["updated_at", "2019-04-08 09:39:13.752920"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:39:13.793124"], ["updated_at", "2019-04-08 09:39:13.793124"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:39:13.803401"], ["updated_at", "2019-04-08 09:39:13.803401"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:39:13.812063"], ["updated_at", "2019-04-08 09:39:13.812063"], ["synced_id", 1]]  (3.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:39:13.823810"], ["updated_at", "2019-04-08 09:39:13.823810"], ["synced_id", 2]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:39:13.831453"], ["updated_at", "2019-04-08 09:39:13.831453"], ["synced_id", 3]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.842543"], ["updated_at", "2019-04-08 09:39:13.842543"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:39:13.854061"], ["updated_at", "2019-04-08 09:39:13.854061"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.863973"], ["updated_at", "2019-04-08 09:39:13.863973"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:39:13.871013"], ["updated_at", "2019-04-08 09:39:13.871013"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.881793"], ["updated_at", "2019-04-08 09:39:13.881793"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (3.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:39:13.895340"], ["updated_at", "2019-04-08 09:39:13.895340"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.906131"], ["updated_at", "2019-04-08 09:39:13.906131"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:39:13.913610"], ["updated_at", "2019-04-08 09:39:13.913610"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.925064"], ["updated_at", "2019-04-08 09:39:13.925064"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.930736"], ["updated_at", "2019-04-08 09:39:13.930736"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 947], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:39:13.938981"], ["id", 947]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 947], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.960392"], ["updated_at", "2019-04-08 09:39:13.960392"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.968551"], ["updated_at", "2019-04-08 09:39:13.968551"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 949], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:39:13.980406"], ["id", 949]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 949], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:13.995048"], ["updated_at", "2019-04-08 09:39:13.995048"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.000977"], ["updated_at", "2019-04-08 09:39:14.000977"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 951], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:39:14.008885"], ["id", 951]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.019723"], ["updated_at", "2019-04-08 09:39:14.019723"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.024962"], ["updated_at", "2019-04-08 09:39:14.024962"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 953], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:39:14.031963"], ["id", 953]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:39:14.048958"], ["updated_at", "2019-04-08 09:39:14.048958"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:39:14.054608"], ["synced_id", 0], ["id", 954]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:39:14.068395"], ["updated_at", "2019-04-08 09:39:14.068395"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629954"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 955], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:39:14.076340"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889154"], ["id", 955]]  (2.2ms) RELEASE SAVEPOINT active_record_1 Account Load (2.5ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 955]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:39:14.094403"], ["updated_at", "2019-04-08 09:39:14.094403"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802754"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.104740"], ["updated_at", "2019-04-08 09:39:14.104740"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 957], ["LIMIT", 1]] Account Update (2.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:39:14.110234"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 957]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 957], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (3.2ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:39:14.156894"], ["updated_at", "2019-04-08 09:39:14.156894"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:39:14.166671"], ["updated_at", "2019-04-08 09:39:14.166671"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1028], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:39:14.175314"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1028]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1028], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.190203"], ["updated_at", "2019-04-08 09:39:14.190203"], ["synced_id", 123], ["host", "test.example"]]  (2.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (3.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.211024"], ["updated_at", "2019-04-08 09:39:14.211024"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.230863"], ["updated_at", "2019-04-08 09:39:14.230863"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (2.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.4ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.260410"], ["updated_at", "2019-04-08 09:39:14.260410"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.270739"], ["updated_at", "2019-04-08 09:39:14.270739"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.279049"], ["updated_at", "2019-04-08 09:39:14.279049"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.285431"], ["updated_at", "2019-04-08 09:39:14.285431"], ["synced_id", 2], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.297036"], ["updated_at", "2019-04-08 09:39:14.297036"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.302345"], ["updated_at", "2019-04-08 09:39:14.302345"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1035], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:39:14.309609"], ["id", 1035]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.317431"], ["updated_at", "2019-04-08 09:39:14.317431"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.322631"], ["updated_at", "2019-04-08 09:39:14.322631"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1037], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:39:14.329811"], ["id", 1037]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1037], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.339193"], ["updated_at", "2019-04-08 09:39:14.339193"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.344788"], ["updated_at", "2019-04-08 09:39:14.344788"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1039], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:39:14.350951"], ["id", 1039]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1039], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.360207"], ["updated_at", "2019-04-08 09:39:14.360207"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.364669"], ["updated_at", "2019-04-08 09:39:14.364669"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:39:14.371480"], ["updated_at", "2019-04-08 09:39:14.371480"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:39:14.380615"], ["updated_at", "2019-04-08 09:39:14.380615"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.384648"], ["updated_at", "2019-04-08 09:39:14.384648"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:39:14.396395"], ["updated_at", "2019-04-08 09:39:14.396395"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.401073"], ["updated_at", "2019-04-08 09:39:14.401073"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:39:14.410986"], ["updated_at", "2019-04-08 09:39:14.410986"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.415768"], ["updated_at", "2019-04-08 09:39:14.415768"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.423096"], ["updated_at", "2019-04-08 09:39:14.423096"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.427771"], ["updated_at", "2019-04-08 09:39:14.427771"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.436019"], ["updated_at", "2019-04-08 09:39:14.436019"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.443085"], ["updated_at", "2019-04-08 09:39:14.443085"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:39:14.452102"], ["updated_at", "2019-04-08 09:39:14.452102"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.458904"], ["updated_at", "2019-04-08 09:39:14.458904"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.464888"], ["updated_at", "2019-04-08 09:39:14.464888"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:39:14.473748"], ["updated_at", "2019-04-08 09:39:14.473748"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802754"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:39:14.480780"], ["updated_at", "2019-04-08 09:39:14.480780"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554629954"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1055], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:39:14.485186"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889154"], ["id", 1055]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1055]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:39:14.498808"], ["updated_at", "2019-04-08 09:39:14.498808"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (2.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (2.2ms) ROLLBACK  (21.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.1ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 22ms (Views: 12.2ms | ActiveRecord: 0.0ms)  (19.9ms) ROLLBACK  (2.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.0ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (4.6ms) ROLLBACK  (2.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.2ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:39:14.684897"], ["updated_at", "2019-04-08 09:39:14.684897"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 27ms (ActiveRecord: 13.3ms)  (1.9ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:39:14.722223"], ["updated_at", "2019-04-08 09:39:14.722223"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 26ms (ActiveRecord: 13.4ms)  (1.4ms) ROLLBACK  (1.8ms) BEGIN  (2.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:39:14.759275"], ["updated_at", "2019-04-08 09:39:14.759275"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 7.5ms)  (1.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (3.1ms) ROLLBACK  (2.9ms) BEGIN  (2.6ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:39:14.805254"], ["updated_at", "2019-04-08 09:39:14.805254"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 9.9ms)  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:17.907520"], ["updated_at", "2019-04-08 09:40:17.907520"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:40:17.971794"], ["updated_at", "2019-04-08 09:40:17.971794"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 35ms (ActiveRecord: 12.5ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:40:17.997163"], ["updated_at", "2019-04-08 09:40:17.997163"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 7.9ms)  (1.3ms) ROLLBACK  (2.1ms) BEGIN  (1.6ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (5.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:40:18.039508"], ["updated_at", "2019-04-08 09:40:18.039508"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 13.2ms)  (1.8ms) SELECT COUNT(*) FROM "accounts" Account Load (2.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (2.5ms) ROLLBACK  (1.8ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:40:18.110763"], ["updated_at", "2019-04-08 09:40:18.110763"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 37ms (ActiveRecord: 8.5ms)  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (2.0ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:40:18.191045"], ["updated_at", "2019-04-08 09:40:18.191045"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:40:18.199132"], ["updated_at", "2019-04-08 09:40:18.199132"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1059], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:40:18.203100"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1059]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1059], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.212114"], ["updated_at", "2019-04-08 09:40:18.212114"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.217864"], ["updated_at", "2019-04-08 09:40:18.217864"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.5ms) BEGIN  (3.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.232216"], ["updated_at", "2019-04-08 09:40:18.232216"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.237137"], ["updated_at", "2019-04-08 09:40:18.237137"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.250080"], ["updated_at", "2019-04-08 09:40:18.250080"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.256613"], ["updated_at", "2019-04-08 09:40:18.256613"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:40:18.271067"], ["updated_at", "2019-04-08 09:40:18.271067"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.2ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:40:18.287292"], ["updated_at", "2019-04-08 09:40:18.287292"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.294704"], ["updated_at", "2019-04-08 09:40:18.294704"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:40:18.304489"], ["updated_at", "2019-04-08 09:40:18.304489"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.309157"], ["updated_at", "2019-04-08 09:40:18.309157"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:40:18.318824"], ["updated_at", "2019-04-08 09:40:18.318824"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.323805"], ["updated_at", "2019-04-08 09:40:18.323805"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.332511"], ["updated_at", "2019-04-08 09:40:18.332511"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.336155"], ["updated_at", "2019-04-08 09:40:18.336155"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1072], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:40:18.342180"], ["id", 1072]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.350037"], ["updated_at", "2019-04-08 09:40:18.350037"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.354143"], ["updated_at", "2019-04-08 09:40:18.354143"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1074], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:40:18.368218"], ["id", 1074]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1074], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.378871"], ["updated_at", "2019-04-08 09:40:18.378871"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.384218"], ["updated_at", "2019-04-08 09:40:18.384218"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1076], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:40:18.395833"], ["id", 1076]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1076], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:40:18.409868"], ["updated_at", "2019-04-08 09:40:18.409868"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630018"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1078], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:40:18.418204"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889218"], ["id", 1078]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1078]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:40:18.437141"], ["updated_at", "2019-04-08 09:40:18.437141"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802818"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.449729"], ["updated_at", "2019-04-08 09:40:18.449729"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.463153"], ["updated_at", "2019-04-08 09:40:18.463153"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.471429"], ["updated_at", "2019-04-08 09:40:18.471429"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.484926"], ["updated_at", "2019-04-08 09:40:18.484926"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.500743"], ["updated_at", "2019-04-08 09:40:18.500743"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.513774"], ["updated_at", "2019-04-08 09:40:18.513774"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (3.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.562213"], ["updated_at", "2019-04-08 09:40:18.562213"], ["synced_id", 1], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.570553"], ["updated_at", "2019-04-08 09:40:18.570553"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.575831"], ["updated_at", "2019-04-08 09:40:18.575831"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.581983"], ["updated_at", "2019-04-08 09:40:18.581983"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:40:18.594030"], ["updated_at", "2019-04-08 09:40:18.594030"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:40:18.605469"], ["updated_at", "2019-04-08 09:40:18.605469"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:40:18.614140"], ["updated_at", "2019-04-08 09:40:18.614140"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:40:18.622265"], ["updated_at", "2019-04-08 09:40:18.622265"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630018"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 966], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:40:18.627698"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889218"], ["id", 966]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 966]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:40:18.639717"], ["updated_at", "2019-04-08 09:40:18.639717"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802818"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.648216"], ["updated_at", "2019-04-08 09:40:18.648216"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 968], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:40:18.652236"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 968]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 968], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.661052"], ["updated_at", "2019-04-08 09:40:18.661052"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.665409"], ["updated_at", "2019-04-08 09:40:18.665409"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 970], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:40:18.670631"], ["id", 970]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.677334"], ["updated_at", "2019-04-08 09:40:18.677334"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.681394"], ["updated_at", "2019-04-08 09:40:18.681394"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 972], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:40:18.686427"], ["id", 972]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 972], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.694488"], ["updated_at", "2019-04-08 09:40:18.694488"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.699003"], ["updated_at", "2019-04-08 09:40:18.699003"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 974], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:40:18.704554"], ["id", 974]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 974], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.712891"], ["updated_at", "2019-04-08 09:40:18.712891"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.716834"], ["updated_at", "2019-04-08 09:40:18.716834"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 976], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:40:18.721567"], ["id", 976]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.728648"], ["updated_at", "2019-04-08 09:40:18.728648"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:40:18.734225"], ["updated_at", "2019-04-08 09:40:18.734225"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.740886"], ["updated_at", "2019-04-08 09:40:18.740886"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:40:18.746677"], ["updated_at", "2019-04-08 09:40:18.746677"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.753438"], ["updated_at", "2019-04-08 09:40:18.753438"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:40:18.758371"], ["updated_at", "2019-04-08 09:40:18.758371"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.2ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.766448"], ["updated_at", "2019-04-08 09:40:18.766448"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:40:18.772359"], ["updated_at", "2019-04-08 09:40:18.772359"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:40:18.782420"], ["updated_at", "2019-04-08 09:40:18.782420"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:40:18.787251"], ["updated_at", "2019-04-08 09:40:18.787251"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:40:18.790834"], ["updated_at", "2019-04-08 09:40:18.790834"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:40:18.804548"], ["updated_at", "2019-04-08 09:40:18.804548"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:40:18.808055"], ["synced_id", 0], ["id", 988]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:40:18.820799"], ["updated_at", "2019-04-08 09:40:18.820799"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:40:18.845666"], ["updated_at", "2019-04-08 09:40:18.845666"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.853584"], ["updated_at", "2019-04-08 09:40:18.853584"], ["synced_id", 123], ["host", "example.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:40:18.857043"], ["updated_at", "2019-04-08 09:40:18.857043"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.868518"], ["updated_at", "2019-04-08 09:40:18.868518"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.888758"], ["updated_at", "2019-04-08 09:40:18.888758"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.903410"], ["updated_at", "2019-04-08 09:40:18.903410"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.917041"], ["updated_at", "2019-04-08 09:40:18.917041"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.938281"], ["updated_at", "2019-04-08 09:40:18.938281"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:40:18.973729"], ["updated_at", "2019-04-08 09:40:18.973729"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (2.0ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.528563"], ["updated_at", "2019-04-08 09:41:52.528563"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.563613"], ["updated_at", "2019-04-08 09:41:52.563613"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.583814"], ["updated_at", "2019-04-08 09:41:52.583814"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.598984"], ["updated_at", "2019-04-08 09:41:52.598984"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.635378"], ["updated_at", "2019-04-08 09:41:52.635378"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.678739"], ["updated_at", "2019-04-08 09:41:52.678739"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.723622"], ["updated_at", "2019-04-08 09:41:52.723622"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (2.5ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.796082"], ["updated_at", "2019-04-08 09:41:52.796082"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:52.824505"], ["updated_at", "2019-04-08 09:41:52.824505"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.838371"], ["updated_at", "2019-04-08 09:41:52.838371"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:41:52.851855"], ["updated_at", "2019-04-08 09:41:52.851855"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802912"], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:41:52.873316"], ["updated_at", "2019-04-08 09:41:52.873316"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630112"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1093], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:41:52.880856"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889312"], ["id", 1093]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1093]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:41:52.895545"], ["updated_at", "2019-04-08 09:41:52.895545"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.903950"], ["updated_at", "2019-04-08 09:41:52.903950"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.908506"], ["updated_at", "2019-04-08 09:41:52.908506"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1095], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:41:52.914410"], ["id", 1095]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.924200"], ["updated_at", "2019-04-08 09:41:52.924200"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.928209"], ["updated_at", "2019-04-08 09:41:52.928209"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1097], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:41:52.933093"], ["id", 1097]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1097], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.941504"], ["updated_at", "2019-04-08 09:41:52.941504"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.945118"], ["updated_at", "2019-04-08 09:41:52.945118"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1099], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:41:52.949873"], ["id", 1099]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1099], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.957334"], ["updated_at", "2019-04-08 09:41:52.957334"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.960958"], ["updated_at", "2019-04-08 09:41:52.960958"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:41:52.968589"], ["updated_at", "2019-04-08 09:41:52.968589"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:41:52.977527"], ["updated_at", "2019-04-08 09:41:52.977527"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.980944"], ["updated_at", "2019-04-08 09:41:52.980944"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:41:52.989393"], ["updated_at", "2019-04-08 09:41:52.989393"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:52.993072"], ["updated_at", "2019-04-08 09:41:52.993072"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:41:52.999927"], ["updated_at", "2019-04-08 09:41:52.999927"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:53.004085"], ["updated_at", "2019-04-08 09:41:53.004085"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:53.010848"], ["updated_at", "2019-04-08 09:41:53.010848"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:53.014259"], ["updated_at", "2019-04-08 09:41:53.014259"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.021922"], ["updated_at", "2019-04-08 09:41:53.021922"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.026077"], ["updated_at", "2019-04-08 09:41:53.026077"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.031174"], ["updated_at", "2019-04-08 09:41:53.031174"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.035482"], ["updated_at", "2019-04-08 09:41:53.035482"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.044638"], ["updated_at", "2019-04-08 09:41:53.044638"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:53.051082"], ["updated_at", "2019-04-08 09:41:53.051082"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:41:53.074943"], ["updated_at", "2019-04-08 09:41:53.074943"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1117], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:41:53.078898"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1117]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1117], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.086835"], ["updated_at", "2019-04-08 09:41:53.086835"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:53.092243"], ["updated_at", "2019-04-08 09:41:53.092243"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:53.097280"], ["updated_at", "2019-04-08 09:41:53.097280"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:41:53.154833"], ["updated_at", "2019-04-08 09:41:53.154833"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 8.5ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:41:53.164486"], ["updated_at", "2019-04-08 09:41:53.164486"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.6ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:41:53.177738"], ["updated_at", "2019-04-08 09:41:53.177738"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.2ms)  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.9ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:41:53.201673"], ["updated_at", "2019-04-08 09:41:53.201673"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.7ms)  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (3.5ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:41:53.228950"], ["updated_at", "2019-04-08 09:41:53.228950"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:41:53.239971"], ["updated_at", "2019-04-08 09:41:53.239971"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:41:53.245400"], ["updated_at", "2019-04-08 09:41:53.245400"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:41:53.251392"], ["updated_at", "2019-04-08 09:41:53.251392"], ["synced_id", 3]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (5.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:41:53.273378"], ["updated_at", "2019-04-08 09:41:53.273378"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (3.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:41:53.287105"], ["updated_at", "2019-04-08 09:41:53.287105"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (2.9ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 998], ["LIMIT", 1]] Account Update (2.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:41:53.301498"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 998]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 998], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.318442"], ["updated_at", "2019-04-08 09:41:53.318442"], ["provider", "bookingsync"], ["synced_id", 456]]  (4.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.330033"], ["updated_at", "2019-04-08 09:41:53.330033"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1000], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:41:53.337498"], ["id", 1000]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.346820"], ["updated_at", "2019-04-08 09:41:53.346820"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.359325"], ["updated_at", "2019-04-08 09:41:53.359325"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1002], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:41:53.366720"], ["id", 1002]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1002], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.377845"], ["updated_at", "2019-04-08 09:41:53.377845"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.388406"], ["updated_at", "2019-04-08 09:41:53.388406"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1004], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:41:53.398350"], ["id", 1004]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1004], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (1.3ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.417121"], ["updated_at", "2019-04-08 09:41:53.417121"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.427276"], ["updated_at", "2019-04-08 09:41:53.427276"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1006], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:41:53.434122"], ["id", 1006]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.444460"], ["updated_at", "2019-04-08 09:41:53.444460"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:41:53.452828"], ["updated_at", "2019-04-08 09:41:53.452828"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.461222"], ["updated_at", "2019-04-08 09:41:53.461222"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:41:53.467597"], ["updated_at", "2019-04-08 09:41:53.467597"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.480658"], ["updated_at", "2019-04-08 09:41:53.480658"], ["provider", "bookingsync"], ["synced_id", 456]]  (3.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:41:53.492999"], ["updated_at", "2019-04-08 09:41:53.492999"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.503651"], ["updated_at", "2019-04-08 09:41:53.503651"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:41:53.516886"], ["updated_at", "2019-04-08 09:41:53.516886"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (3.1ms) ROLLBACK  (0.8ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:41:53.534949"], ["updated_at", "2019-04-08 09:41:53.534949"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:41:53.540402"], ["synced_id", 0], ["id", 1015]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:41:53.557199"], ["updated_at", "2019-04-08 09:41:53.557199"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802913"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:41:53.567740"], ["updated_at", "2019-04-08 09:41:53.567740"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630113"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1017], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:41:53.575686"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889313"], ["id", 1017]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (1.1ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1017]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:41:53.591226"], ["updated_at", "2019-04-08 09:41:53.591226"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:41:53.598945"], ["updated_at", "2019-04-08 09:41:53.598945"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (2.7ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.660218"], ["updated_at", "2019-04-08 09:41:53.660218"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:41:53.667621"], ["updated_at", "2019-04-08 09:41:53.667621"], ["synced_id", 123], ["host", "test.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (4.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:41:53.689346"], ["updated_at", "2019-04-08 09:41:53.689346"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (2.4ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.4ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:06.981467"], ["updated_at", "2019-04-08 09:42:06.981467"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:42:07.024818"], ["updated_at", "2019-04-08 09:42:07.024818"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.035901"], ["updated_at", "2019-04-08 09:42:07.035901"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1022], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:42:07.041473"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1022]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1022], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:42:07.063965"], ["updated_at", "2019-04-08 09:42:07.063965"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:42:07.078208"], ["updated_at", "2019-04-08 09:42:07.078208"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:42:07.083018"], ["synced_id", 0], ["id", 1024]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:42:07.100062"], ["updated_at", "2019-04-08 09:42:07.100062"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802927"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:42:07.109882"], ["updated_at", "2019-04-08 09:42:07.109882"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630127"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1026], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:42:07.115981"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889327"], ["id", 1026]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1026]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:42:07.129320"], ["updated_at", "2019-04-08 09:42:07.129320"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:42:07.134787"], ["updated_at", "2019-04-08 09:42:07.134787"], ["synced_id", 2]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:42:07.140290"], ["updated_at", "2019-04-08 09:42:07.140290"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.153365"], ["updated_at", "2019-04-08 09:42:07.153365"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:42:07.170516"], ["updated_at", "2019-04-08 09:42:07.170516"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.181478"], ["updated_at", "2019-04-08 09:42:07.181478"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:42:07.188525"], ["updated_at", "2019-04-08 09:42:07.188525"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.199284"], ["updated_at", "2019-04-08 09:42:07.199284"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:42:07.206880"], ["updated_at", "2019-04-08 09:42:07.206880"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.215247"], ["updated_at", "2019-04-08 09:42:07.215247"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:42:07.222019"], ["updated_at", "2019-04-08 09:42:07.222019"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.233448"], ["updated_at", "2019-04-08 09:42:07.233448"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.239254"], ["updated_at", "2019-04-08 09:42:07.239254"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1039], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:42:07.247402"], ["id", 1039]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1039], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.259904"], ["updated_at", "2019-04-08 09:42:07.259904"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.264961"], ["updated_at", "2019-04-08 09:42:07.264961"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1041], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:42:07.272545"], ["id", 1041]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1041], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.282986"], ["updated_at", "2019-04-08 09:42:07.282986"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.287320"], ["updated_at", "2019-04-08 09:42:07.287320"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1043], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:42:07.293341"], ["id", 1043]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.303687"], ["updated_at", "2019-04-08 09:42:07.303687"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.314678"], ["updated_at", "2019-04-08 09:42:07.314678"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1045], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:42:07.325086"], ["id", 1045]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:42:07.337913"], ["updated_at", "2019-04-08 09:42:07.337913"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:42:07.387190"], ["updated_at", "2019-04-08 09:42:07.387190"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.403208"], ["updated_at", "2019-04-08 09:42:07.403208"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.408985"], ["updated_at", "2019-04-08 09:42:07.408985"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:42:07.419556"], ["updated_at", "2019-04-08 09:42:07.419556"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:42:07.429833"], ["updated_at", "2019-04-08 09:42:07.429833"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1126], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:42:07.434460"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1126]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1126], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.444413"], ["updated_at", "2019-04-08 09:42:07.444413"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.461141"], ["updated_at", "2019-04-08 09:42:07.461141"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.466319"], ["updated_at", "2019-04-08 09:42:07.466319"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (3.1ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.485789"], ["updated_at", "2019-04-08 09:42:07.485789"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.491628"], ["updated_at", "2019-04-08 09:42:07.491628"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:42:07.501576"], ["updated_at", "2019-04-08 09:42:07.501576"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:42:07.512070"], ["updated_at", "2019-04-08 09:42:07.512070"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.517182"], ["updated_at", "2019-04-08 09:42:07.517182"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:42:07.529109"], ["updated_at", "2019-04-08 09:42:07.529109"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.534166"], ["updated_at", "2019-04-08 09:42:07.534166"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:42:07.544147"], ["updated_at", "2019-04-08 09:42:07.544147"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.548800"], ["updated_at", "2019-04-08 09:42:07.548800"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.557334"], ["updated_at", "2019-04-08 09:42:07.557334"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.562426"], ["updated_at", "2019-04-08 09:42:07.562426"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1139], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:42:07.569153"], ["id", 1139]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.577376"], ["updated_at", "2019-04-08 09:42:07.577376"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.581402"], ["updated_at", "2019-04-08 09:42:07.581402"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1141], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:42:07.586340"], ["id", 1141]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1141], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.593974"], ["updated_at", "2019-04-08 09:42:07.593974"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.598008"], ["updated_at", "2019-04-08 09:42:07.598008"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1143], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:42:07.603461"], ["id", 1143]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1143], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:42:07.612465"], ["updated_at", "2019-04-08 09:42:07.612465"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.623953"], ["updated_at", "2019-04-08 09:42:07.623953"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.628477"], ["updated_at", "2019-04-08 09:42:07.628477"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.632921"], ["updated_at", "2019-04-08 09:42:07.632921"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.636884"], ["updated_at", "2019-04-08 09:42:07.636884"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.645924"], ["updated_at", "2019-04-08 09:42:07.645924"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.651341"], ["updated_at", "2019-04-08 09:42:07.651341"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.657870"], ["updated_at", "2019-04-08 09:42:07.657870"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.665540"], ["updated_at", "2019-04-08 09:42:07.665540"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.671604"], ["updated_at", "2019-04-08 09:42:07.671604"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:42:07.681226"], ["updated_at", "2019-04-08 09:42:07.681226"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630127"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1152], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:42:07.686440"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889327"], ["id", 1152]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1152]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:42:07.698389"], ["updated_at", "2019-04-08 09:42:07.698389"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554802927"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:42:07.705973"], ["updated_at", "2019-04-08 09:42:07.705973"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.713406"], ["updated_at", "2019-04-08 09:42:07.713406"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:42:07.804599"], ["updated_at", "2019-04-08 09:42:07.804599"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.4ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:42:07.817922"], ["updated_at", "2019-04-08 09:42:07.817922"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.0ms)  (0.6ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:42:07.831296"], ["updated_at", "2019-04-08 09:42:07.831296"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (2.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:42:07.857756"], ["updated_at", "2019-04-08 09:42:07.857756"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 8.4ms)  (1.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.904069"], ["updated_at", "2019-04-08 09:42:07.904069"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.932738"], ["updated_at", "2019-04-08 09:42:07.932738"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.952974"], ["updated_at", "2019-04-08 09:42:07.952974"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.970446"], ["updated_at", "2019-04-08 09:42:07.970446"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:07.986549"], ["updated_at", "2019-04-08 09:42:07.986549"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:42:08.003518"], ["updated_at", "2019-04-08 09:42:08.003518"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:32.973909"], ["updated_at", "2019-04-08 09:47:32.973909"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1051], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:47:32.979647"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1051]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1051], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:47:32.995723"], ["updated_at", "2019-04-08 09:47:32.995723"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 Account Update (2.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:47:33.004099"], ["synced_id", 0], ["id", 1052]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:47:33.067959"], ["updated_at", "2019-04-08 09:47:33.067959"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:47:33.079645"], ["updated_at", "2019-04-08 09:47:33.079645"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:47:33.089026"], ["updated_at", "2019-04-08 09:47:33.089026"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:47:33.118265"], ["updated_at", "2019-04-08 09:47:33.118265"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803253"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:47:33.127286"], ["updated_at", "2019-04-08 09:47:33.127286"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630453"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1056], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:47:33.134955"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889653"], ["id", 1056]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1056]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:47:33.153122"], ["updated_at", "2019-04-08 09:47:33.153122"], ["synced_id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:47:33.160306"], ["updated_at", "2019-04-08 09:47:33.160306"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:47:33.171075"], ["updated_at", "2019-04-08 09:47:33.171075"], ["synced_id", 3]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.184697"], ["updated_at", "2019-04-08 09:47:33.184697"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.191306"], ["updated_at", "2019-04-08 09:47:33.191306"], ["provider", "bookingsync"], ["synced_id", 123]]  (11.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1061], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:47:33.210281"], ["id", 1061]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1061], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.222693"], ["updated_at", "2019-04-08 09:47:33.222693"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.228684"], ["updated_at", "2019-04-08 09:47:33.228684"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1063], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:47:33.237646"], ["id", 1063]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1063], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.248443"], ["updated_at", "2019-04-08 09:47:33.248443"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.253207"], ["updated_at", "2019-04-08 09:47:33.253207"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1065], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:47:33.260772"], ["id", 1065]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.270607"], ["updated_at", "2019-04-08 09:47:33.270607"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.275269"], ["updated_at", "2019-04-08 09:47:33.275269"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1067], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:47:33.283529"], ["id", 1067]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.292703"], ["updated_at", "2019-04-08 09:47:33.292703"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:47:33.308045"], ["updated_at", "2019-04-08 09:47:33.308045"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.318008"], ["updated_at", "2019-04-08 09:47:33.318008"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:47:33.323975"], ["updated_at", "2019-04-08 09:47:33.323975"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.339288"], ["updated_at", "2019-04-08 09:47:33.339288"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:47:33.346123"], ["updated_at", "2019-04-08 09:47:33.346123"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.354255"], ["updated_at", "2019-04-08 09:47:33.354255"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:47:33.359686"], ["updated_at", "2019-04-08 09:47:33.359686"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:47:33.368058"], ["updated_at", "2019-04-08 09:47:33.368058"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:47:33.389836"], ["updated_at", "2019-04-08 09:47:33.389836"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.400986"], ["updated_at", "2019-04-08 09:47:33.400986"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.405551"], ["updated_at", "2019-04-08 09:47:33.405551"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.441575"], ["updated_at", "2019-04-08 09:47:33.441575"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.469258"], ["updated_at", "2019-04-08 09:47:33.469258"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.485271"], ["updated_at", "2019-04-08 09:47:33.485271"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.506603"], ["updated_at", "2019-04-08 09:47:33.506603"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.521848"], ["updated_at", "2019-04-08 09:47:33.521848"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.543821"], ["updated_at", "2019-04-08 09:47:33.543821"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.558919"], ["updated_at", "2019-04-08 09:47:33.558919"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:47:33.579055"], ["updated_at", "2019-04-08 09:47:33.579055"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1159], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1159], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 09:47:33.593947"], ["id", 1159]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1159], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.602301"], ["updated_at", "2019-04-08 09:47:33.602301"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.607904"], ["updated_at", "2019-04-08 09:47:33.607904"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.619171"], ["updated_at", "2019-04-08 09:47:33.619171"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:47:33.636029"], ["updated_at", "2019-04-08 09:47:33.636029"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630453"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1162], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:47:33.644114"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889653"], ["id", 1162]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.0ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1162]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:47:33.658789"], ["updated_at", "2019-04-08 09:47:33.658789"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803253"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.667503"], ["updated_at", "2019-04-08 09:47:33.667503"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.674277"], ["updated_at", "2019-04-08 09:47:33.674277"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.697369"], ["updated_at", "2019-04-08 09:47:33.697369"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.701689"], ["updated_at", "2019-04-08 09:47:33.701689"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:47:33.709772"], ["updated_at", "2019-04-08 09:47:33.709772"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:47:33.719239"], ["updated_at", "2019-04-08 09:47:33.719239"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.723971"], ["updated_at", "2019-04-08 09:47:33.723971"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:47:33.736461"], ["updated_at", "2019-04-08 09:47:33.736461"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.740824"], ["updated_at", "2019-04-08 09:47:33.740824"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:47:33.749752"], ["updated_at", "2019-04-08 09:47:33.749752"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.754678"], ["updated_at", "2019-04-08 09:47:33.754678"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.762744"], ["updated_at", "2019-04-08 09:47:33.762744"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.767249"], ["updated_at", "2019-04-08 09:47:33.767249"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1174], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:47:33.773431"], ["id", 1174]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.780806"], ["updated_at", "2019-04-08 09:47:33.780806"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.784426"], ["updated_at", "2019-04-08 09:47:33.784426"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1176], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:47:33.789373"], ["id", 1176]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1176], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.797198"], ["updated_at", "2019-04-08 09:47:33.797198"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.801466"], ["updated_at", "2019-04-08 09:47:33.801466"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1178], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:47:33.807008"], ["id", 1178]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1178], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.815826"], ["updated_at", "2019-04-08 09:47:33.815826"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.820636"], ["updated_at", "2019-04-08 09:47:33.820636"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.829993"], ["updated_at", "2019-04-08 09:47:33.829993"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.836535"], ["updated_at", "2019-04-08 09:47:33.836535"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:47:33.842355"], ["updated_at", "2019-04-08 09:47:33.842355"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.849495"], ["updated_at", "2019-04-08 09:47:33.849495"], ["synced_id", 1], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.852877"], ["updated_at", "2019-04-08 09:47:33.852877"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.856436"], ["updated_at", "2019-04-08 09:47:33.856436"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:47:33.859931"], ["updated_at", "2019-04-08 09:47:33.859931"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:47:33.867179"], ["updated_at", "2019-04-08 09:47:33.867179"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:47:33.921139"], ["updated_at", "2019-04-08 09:47:33.921139"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.2ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:47:33.933365"], ["updated_at", "2019-04-08 09:47:33.933365"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:47:33.946926"], ["updated_at", "2019-04-08 09:47:33.946926"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.9ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (4.6ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:47:33.967430"], ["updated_at", "2019-04-08 09:47:33.967430"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.2ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 10ms (Views: 5.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.8ms) ROLLBACK  (1.5ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:49:43.567635"], ["updated_at", "2019-04-08 09:49:43.567635"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:49:43.606601"], ["updated_at", "2019-04-08 09:49:43.606601"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:49:43.638092"], ["updated_at", "2019-04-08 09:49:43.638092"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:49:43.643288"], ["synced_id", 0], ["id", 1082]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:49:43.667600"], ["updated_at", "2019-04-08 09:49:43.667600"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:49:43.674674"], ["updated_at", "2019-04-08 09:49:43.674674"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.699920"], ["updated_at", "2019-04-08 09:49:43.699920"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:49:43.708586"], ["updated_at", "2019-04-08 09:49:43.708586"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.716099"], ["updated_at", "2019-04-08 09:49:43.716099"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:49:43.724004"], ["updated_at", "2019-04-08 09:49:43.724004"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.736593"], ["updated_at", "2019-04-08 09:49:43.736593"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:49:43.746003"], ["updated_at", "2019-04-08 09:49:43.746003"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.757637"], ["updated_at", "2019-04-08 09:49:43.757637"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:49:43.767551"], ["updated_at", "2019-04-08 09:49:43.767551"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.780476"], ["updated_at", "2019-04-08 09:49:43.780476"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.786100"], ["updated_at", "2019-04-08 09:49:43.786100"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1094], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:49:43.795765"], ["id", 1094]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.807398"], ["updated_at", "2019-04-08 09:49:43.807398"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.814934"], ["updated_at", "2019-04-08 09:49:43.814934"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1096], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:49:43.824540"], ["id", 1096]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1096], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.835192"], ["updated_at", "2019-04-08 09:49:43.835192"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.840656"], ["updated_at", "2019-04-08 09:49:43.840656"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1098], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:49:43.848902"], ["id", 1098]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1098], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.860102"], ["updated_at", "2019-04-08 09:49:43.860102"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.864607"], ["updated_at", "2019-04-08 09:49:43.864607"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1100], ["LIMIT", 1]] Account Update (2.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:49:43.869809"], ["id", 1100]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:43.879610"], ["updated_at", "2019-04-08 09:49:43.879610"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1101], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1101], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 09:49:43.884820"], ["id", 1101]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1101], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:49:43.895567"], ["updated_at", "2019-04-08 09:49:43.895567"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630583"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1102], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:49:43.900546"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889783"], ["id", 1102]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1102]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:49:43.911885"], ["updated_at", "2019-04-08 09:49:43.911885"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803383"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:49:43.919028"], ["updated_at", "2019-04-08 09:49:43.919028"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:49:43.923449"], ["updated_at", "2019-04-08 09:49:43.923449"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:49:43.927117"], ["updated_at", "2019-04-08 09:49:43.927117"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.960915"], ["updated_at", "2019-04-08 09:49:43.960915"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:43.968154"], ["updated_at", "2019-04-08 09:49:43.968154"], ["synced_id", 123], ["host", "test.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:49:43.983634"], ["updated_at", "2019-04-08 09:49:43.983634"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.007519"], ["updated_at", "2019-04-08 09:49:44.007519"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.035437"], ["updated_at", "2019-04-08 09:49:44.035437"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.056556"], ["updated_at", "2019-04-08 09:49:44.056556"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.071753"], ["updated_at", "2019-04-08 09:49:44.071753"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.086806"], ["updated_at", "2019-04-08 09:49:44.086806"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.110948"], ["updated_at", "2019-04-08 09:49:44.110948"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.127258"], ["updated_at", "2019-04-08 09:49:44.127258"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:49:44.150080"], ["updated_at", "2019-04-08 09:49:44.150080"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1192], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1192], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 09:49:44.156709"], ["id", 1192]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1192], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.165376"], ["updated_at", "2019-04-08 09:49:44.165376"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.169132"], ["updated_at", "2019-04-08 09:49:44.169132"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (3.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.187436"], ["updated_at", "2019-04-08 09:49:44.187436"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.193117"], ["updated_at", "2019-04-08 09:49:44.193117"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:49:44.201934"], ["updated_at", "2019-04-08 09:49:44.201934"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:49:44.213582"], ["updated_at", "2019-04-08 09:49:44.213582"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.220815"], ["updated_at", "2019-04-08 09:49:44.220815"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:49:44.233511"], ["updated_at", "2019-04-08 09:49:44.233511"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.239130"], ["updated_at", "2019-04-08 09:49:44.239130"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:49:44.248922"], ["updated_at", "2019-04-08 09:49:44.248922"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.253214"], ["updated_at", "2019-04-08 09:49:44.253214"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.260773"], ["updated_at", "2019-04-08 09:49:44.260773"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.265695"], ["updated_at", "2019-04-08 09:49:44.265695"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1204], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:49:44.272414"], ["id", 1204]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.280915"], ["updated_at", "2019-04-08 09:49:44.280915"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.285021"], ["updated_at", "2019-04-08 09:49:44.285021"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1206], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:49:44.291548"], ["id", 1206]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1206], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.300054"], ["updated_at", "2019-04-08 09:49:44.300054"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.303811"], ["updated_at", "2019-04-08 09:49:44.303811"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1208], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:49:44.308785"], ["id", 1208]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1208], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.318065"], ["updated_at", "2019-04-08 09:49:44.318065"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:44.343446"], ["updated_at", "2019-04-08 09:49:44.343446"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.351786"], ["updated_at", "2019-04-08 09:49:44.351786"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.358600"], ["updated_at", "2019-04-08 09:49:44.358600"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:44.366995"], ["updated_at", "2019-04-08 09:49:44.366995"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.373765"], ["updated_at", "2019-04-08 09:49:44.373765"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:44.397300"], ["updated_at", "2019-04-08 09:49:44.397300"], ["synced_id", 1], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:44.401030"], ["updated_at", "2019-04-08 09:49:44.401030"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:44.404874"], ["updated_at", "2019-04-08 09:49:44.404874"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:44.408924"], ["updated_at", "2019-04-08 09:49:44.408924"], ["synced_id", 2], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:49:44.418118"], ["updated_at", "2019-04-08 09:49:44.418118"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803384"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:49:44.426252"], ["updated_at", "2019-04-08 09:49:44.426252"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630584"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1218], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:49:44.431677"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889784"], ["id", 1218]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1218]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:49:44.441751"], ["updated_at", "2019-04-08 09:49:44.441751"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:49:44.449231"], ["updated_at", "2019-04-08 09:49:44.449231"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:49:44.457625"], ["updated_at", "2019-04-08 09:49:44.457625"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:49:44.497618"], ["updated_at", "2019-04-08 09:49:44.497618"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:49:44.510911"], ["updated_at", "2019-04-08 09:49:44.510911"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.9ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:49:44.524719"], ["updated_at", "2019-04-08 09:49:44.524719"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:49:44.540973"], ["updated_at", "2019-04-08 09:49:44.540973"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.7ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:02.565631"], ["updated_at", "2019-04-08 09:50:02.565631"], ["synced_id", 123], ["host", "example.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:02.572023"], ["updated_at", "2019-04-08 09:50:02.572023"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:50:02.598538"], ["updated_at", "2019-04-08 09:50:02.598538"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:50:02.618638"], ["updated_at", "2019-04-08 09:50:02.618638"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:50:02.630617"], ["updated_at", "2019-04-08 09:50:02.630617"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.7ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:50:02.647124"], ["updated_at", "2019-04-08 09:50:02.647124"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.2ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:50:02.663815"], ["updated_at", "2019-04-08 09:50:02.663815"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.6ms)  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.763287"], ["updated_at", "2019-04-08 09:50:02.763287"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.796857"], ["updated_at", "2019-04-08 09:50:02.796857"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.820182"], ["updated_at", "2019-04-08 09:50:02.820182"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.840134"], ["updated_at", "2019-04-08 09:50:02.840134"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.856030"], ["updated_at", "2019-04-08 09:50:02.856030"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.877380"], ["updated_at", "2019-04-08 09:50:02.877380"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.906285"], ["updated_at", "2019-04-08 09:50:02.906285"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:50:02.916517"], ["updated_at", "2019-04-08 09:50:02.916517"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:50:02.926147"], ["updated_at", "2019-04-08 09:50:02.926147"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803402"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:50:02.936060"], ["updated_at", "2019-04-08 09:50:02.936060"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630602"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1227], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:50:02.942263"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889802"], ["id", 1227]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1227]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:50:02.954359"], ["updated_at", "2019-04-08 09:50:02.954359"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1228], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1228], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 09:50:02.961115"], ["id", 1228]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1228], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.985714"], ["updated_at", "2019-04-08 09:50:02.985714"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:02.990622"], ["updated_at", "2019-04-08 09:50:02.990622"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1229], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:50:02.996506"], ["id", 1229]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.007210"], ["updated_at", "2019-04-08 09:50:03.007210"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.013783"], ["updated_at", "2019-04-08 09:50:03.013783"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1231], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:50:03.022115"], ["id", 1231]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1231], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.034385"], ["updated_at", "2019-04-08 09:50:03.034385"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.039482"], ["updated_at", "2019-04-08 09:50:03.039482"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1233], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:50:03.045606"], ["id", 1233]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1233], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.054492"], ["updated_at", "2019-04-08 09:50:03.054492"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.065865"], ["updated_at", "2019-04-08 09:50:03.065865"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:50:03.077027"], ["updated_at", "2019-04-08 09:50:03.077027"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:50:03.088802"], ["updated_at", "2019-04-08 09:50:03.088802"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.094157"], ["updated_at", "2019-04-08 09:50:03.094157"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:50:03.103735"], ["updated_at", "2019-04-08 09:50:03.103735"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.109941"], ["updated_at", "2019-04-08 09:50:03.109941"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:50:03.118068"], ["updated_at", "2019-04-08 09:50:03.118068"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.123515"], ["updated_at", "2019-04-08 09:50:03.123515"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.130824"], ["updated_at", "2019-04-08 09:50:03.130824"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.135795"], ["updated_at", "2019-04-08 09:50:03.135795"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.146050"], ["updated_at", "2019-04-08 09:50:03.146050"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.163660"], ["updated_at", "2019-04-08 09:50:03.163660"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.170530"], ["updated_at", "2019-04-08 09:50:03.170530"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.177786"], ["updated_at", "2019-04-08 09:50:03.177786"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.186080"], ["updated_at", "2019-04-08 09:50:03.186080"], ["synced_id", 1], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.191283"], ["updated_at", "2019-04-08 09:50:03.191283"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.195308"], ["updated_at", "2019-04-08 09:50:03.195308"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.199168"], ["updated_at", "2019-04-08 09:50:03.199168"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.207730"], ["updated_at", "2019-04-08 09:50:03.207730"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.213744"], ["updated_at", "2019-04-08 09:50:03.213744"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.222221"], ["updated_at", "2019-04-08 09:50:03.222221"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.227938"], ["updated_at", "2019-04-08 09:50:03.227938"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:50:03.256785"], ["updated_at", "2019-04-08 09:50:03.256785"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:50:03.264238"], ["updated_at", "2019-04-08 09:50:03.264238"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:50:03.268249"], ["updated_at", "2019-04-08 09:50:03.268249"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:50:03.273144"], ["updated_at", "2019-04-08 09:50:03.273144"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:50:03.281597"], ["updated_at", "2019-04-08 09:50:03.281597"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.303671"], ["updated_at", "2019-04-08 09:50:03.303671"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.308634"], ["updated_at", "2019-04-08 09:50:03.308634"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1120], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:50:03.313311"], ["id", 1120]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.320323"], ["updated_at", "2019-04-08 09:50:03.320323"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.324756"], ["updated_at", "2019-04-08 09:50:03.324756"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1122], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:50:03.329589"], ["id", 1122]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1122], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.337958"], ["updated_at", "2019-04-08 09:50:03.337958"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.344080"], ["updated_at", "2019-04-08 09:50:03.344080"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1124], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:50:03.350503"], ["id", 1124]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1124], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.359567"], ["updated_at", "2019-04-08 09:50:03.359567"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.363595"], ["updated_at", "2019-04-08 09:50:03.363595"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1126], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:50:03.368833"], ["id", 1126]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.375608"], ["updated_at", "2019-04-08 09:50:03.375608"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:50:03.381349"], ["updated_at", "2019-04-08 09:50:03.381349"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.390746"], ["updated_at", "2019-04-08 09:50:03.390746"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:50:03.396084"], ["updated_at", "2019-04-08 09:50:03.396084"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.403084"], ["updated_at", "2019-04-08 09:50:03.403084"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:50:03.408961"], ["updated_at", "2019-04-08 09:50:03.408961"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:50:03.415759"], ["updated_at", "2019-04-08 09:50:03.415759"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:50:03.421052"], ["updated_at", "2019-04-08 09:50:03.421052"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:50:03.428866"], ["updated_at", "2019-04-08 09:50:03.428866"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1135], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1135], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 09:50:03.434445"], ["id", 1135]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1135], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:50:03.443437"], ["updated_at", "2019-04-08 09:50:03.443437"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:50:03.450715"], ["updated_at", "2019-04-08 09:50:03.450715"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803403"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:50:03.459303"], ["updated_at", "2019-04-08 09:50:03.459303"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630603"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1138], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:50:03.464139"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889803"], ["id", 1138]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1138]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:50:03.482547"], ["updated_at", "2019-04-08 09:50:03.482547"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Update (2.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:50:03.487589"], ["synced_id", 0], ["id", 1139]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:50:03.504720"], ["updated_at", "2019-04-08 09:50:03.504720"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:09.997507"], ["updated_at", "2019-04-08 09:52:09.997507"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.024174"], ["updated_at", "2019-04-08 09:52:10.024174"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.064492"], ["updated_at", "2019-04-08 09:52:10.064492"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.083322"], ["updated_at", "2019-04-08 09:52:10.083322"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.102241"], ["updated_at", "2019-04-08 09:52:10.102241"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.125744"], ["updated_at", "2019-04-08 09:52:10.125744"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.148715"], ["updated_at", "2019-04-08 09:52:10.148715"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.212264"], ["updated_at", "2019-04-08 09:52:10.212264"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.220474"], ["updated_at", "2019-04-08 09:52:10.220474"], ["synced_id", 2], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.227789"], ["updated_at", "2019-04-08 09:52:10.227789"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.233365"], ["updated_at", "2019-04-08 09:52:10.233365"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:52:10.243839"], ["updated_at", "2019-04-08 09:52:10.243839"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803530"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 09:52:10.253112"], ["updated_at", "2019-04-08 09:52:10.253112"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630730"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1260], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 09:52:10.259841"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889930"], ["id", 1260]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1260]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:52:10.273942"], ["updated_at", "2019-04-08 09:52:10.273942"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1261], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1261], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 09:52:10.296565"], ["id", 1261]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1261], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.307139"], ["updated_at", "2019-04-08 09:52:10.307139"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.311428"], ["updated_at", "2019-04-08 09:52:10.311428"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.319516"], ["updated_at", "2019-04-08 09:52:10.319516"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.323825"], ["updated_at", "2019-04-08 09:52:10.323825"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:52:10.333216"], ["updated_at", "2019-04-08 09:52:10.333216"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:52:10.345817"], ["updated_at", "2019-04-08 09:52:10.345817"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.350880"], ["updated_at", "2019-04-08 09:52:10.350880"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:52:10.360359"], ["updated_at", "2019-04-08 09:52:10.360359"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.366183"], ["updated_at", "2019-04-08 09:52:10.366183"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:52:10.377467"], ["updated_at", "2019-04-08 09:52:10.377467"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.383148"], ["updated_at", "2019-04-08 09:52:10.383148"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.391430"], ["updated_at", "2019-04-08 09:52:10.391430"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.395489"], ["updated_at", "2019-04-08 09:52:10.395489"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1273], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:52:10.401150"], ["id", 1273]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.409746"], ["updated_at", "2019-04-08 09:52:10.409746"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.415057"], ["updated_at", "2019-04-08 09:52:10.415057"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1275], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:52:10.423454"], ["id", 1275]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1275], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.433889"], ["updated_at", "2019-04-08 09:52:10.433889"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.437970"], ["updated_at", "2019-04-08 09:52:10.437970"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1277], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:52:10.443281"], ["id", 1277]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1277], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:52:10.452440"], ["updated_at", "2019-04-08 09:52:10.452440"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.459432"], ["updated_at", "2019-04-08 09:52:10.459432"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.466607"], ["updated_at", "2019-04-08 09:52:10.466607"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.475901"], ["updated_at", "2019-04-08 09:52:10.475901"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.482897"], ["updated_at", "2019-04-08 09:52:10.482897"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.489643"], ["updated_at", "2019-04-08 09:52:10.489643"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.497906"], ["updated_at", "2019-04-08 09:52:10.497906"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.519028"], ["updated_at", "2019-04-08 09:52:10.519028"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.525648"], ["updated_at", "2019-04-08 09:52:10.525648"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.597385"], ["updated_at", "2019-04-08 09:52:10.597385"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:52:10.607684"], ["updated_at", "2019-04-08 09:52:10.607684"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "accounts"  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.618193"], ["updated_at", "2019-04-08 09:52:10.618193"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:52:10.624852"], ["updated_at", "2019-04-08 09:52:10.624852"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.630688"], ["updated_at", "2019-04-08 09:52:10.630688"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:52:10.634920"], ["updated_at", "2019-04-08 09:52:10.634920"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.642611"], ["updated_at", "2019-04-08 09:52:10.642611"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:52:10.648244"], ["updated_at", "2019-04-08 09:52:10.648244"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.657144"], ["updated_at", "2019-04-08 09:52:10.657144"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.662087"], ["updated_at", "2019-04-08 09:52:10.662087"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1150], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:52:10.668458"], ["id", 1150]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.675291"], ["updated_at", "2019-04-08 09:52:10.675291"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.679177"], ["updated_at", "2019-04-08 09:52:10.679177"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1152], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:52:10.684327"], ["id", 1152]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.690926"], ["updated_at", "2019-04-08 09:52:10.690926"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.695120"], ["updated_at", "2019-04-08 09:52:10.695120"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1154], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:52:10.699982"], ["id", 1154]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1154], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.708762"], ["updated_at", "2019-04-08 09:52:10.708762"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.712874"], ["updated_at", "2019-04-08 09:52:10.712874"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1156], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 09:52:10.719399"], ["id", 1156]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1156], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:52:10.729228"], ["updated_at", "2019-04-08 09:52:10.729228"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554803530"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:52:10.736639"], ["updated_at", "2019-04-08 09:52:10.736639"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554630730"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1158], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 09:52:10.741440"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554889930"], ["id", 1158]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1158]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:52:10.750126"], ["updated_at", "2019-04-08 09:52:10.750126"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 09:52:10.779351"], ["updated_at", "2019-04-08 09:52:10.779351"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:52:10.787340"], ["updated_at", "2019-04-08 09:52:10.787340"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:52:10.794838"], ["updated_at", "2019-04-08 09:52:10.794838"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:52:10.798163"], ["updated_at", "2019-04-08 09:52:10.798163"], ["synced_id", 2]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:52:10.801742"], ["updated_at", "2019-04-08 09:52:10.801742"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:52:10.812219"], ["updated_at", "2019-04-08 09:52:10.812219"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 09:52:10.822617"], ["updated_at", "2019-04-08 09:52:10.822617"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 09:52:10.826960"], ["synced_id", 0], ["id", 1165]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 09:52:10.842884"], ["updated_at", "2019-04-08 09:52:10.842884"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1166], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1166], ["LIMIT", 1]] Account Update (2.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 09:52:10.856346"], ["id", 1166]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1166], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:52:10.876324"], ["updated_at", "2019-04-08 09:52:10.876324"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:52:10.889098"], ["updated_at", "2019-04-08 09:52:10.889098"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.6ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 09:52:10.905208"], ["updated_at", "2019-04-08 09:52:10.905208"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 09:52:10.922342"], ["updated_at", "2019-04-08 09:52:10.922342"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.4ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 09:52:10.968369"], ["updated_at", "2019-04-08 09:52:10.968369"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.980850"], ["updated_at", "2019-04-08 09:52:10.980850"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 09:52:10.985969"], ["updated_at", "2019-04-08 09:52:10.985969"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.116636"], ["updated_at", "2019-04-08 10:06:20.116636"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (1.0ms) BEGIN  (1.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.179129"], ["updated_at", "2019-04-08 10:06:20.179129"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.215610"], ["updated_at", "2019-04-08 10:06:20.215610"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.244962"], ["updated_at", "2019-04-08 10:06:20.244962"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.269020"], ["updated_at", "2019-04-08 10:06:20.269020"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.295360"], ["updated_at", "2019-04-08 10:06:20.295360"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.322880"], ["updated_at", "2019-04-08 10:06:20.322880"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:06:20.405702"], ["updated_at", "2019-04-08 10:06:20.405702"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 27ms (ActiveRecord: 11.9ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:06:20.418761"], ["updated_at", "2019-04-08 10:06:20.418761"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:06:20.451653"], ["updated_at", "2019-04-08 10:06:20.451653"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 7.6ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:06:20.469655"], ["updated_at", "2019-04-08 10:06:20.469655"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.3ms)  (1.8ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 16ms (Views: 11.0ms | ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (1.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:06:20.526136"], ["updated_at", "2019-04-08 10:06:20.526136"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.543234"], ["updated_at", "2019-04-08 10:06:20.543234"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.550233"], ["updated_at", "2019-04-08 10:06:20.550233"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:06:20.569997"], ["updated_at", "2019-04-08 10:06:20.569997"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (4.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:06:20.585283"], ["updated_at", "2019-04-08 10:06:20.585283"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.597102"], ["updated_at", "2019-04-08 10:06:20.597102"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.603209"], ["updated_at", "2019-04-08 10:06:20.603209"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1177], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:06:20.610403"], ["id", 1177]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.618756"], ["updated_at", "2019-04-08 10:06:20.618756"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.623868"], ["updated_at", "2019-04-08 10:06:20.623868"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1179], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:06:20.632236"], ["id", 1179]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.642482"], ["updated_at", "2019-04-08 10:06:20.642482"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.647397"], ["updated_at", "2019-04-08 10:06:20.647397"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1181], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:06:20.653537"], ["id", 1181]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1181], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.662976"], ["updated_at", "2019-04-08 10:06:20.662976"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.667021"], ["updated_at", "2019-04-08 10:06:20.667021"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1183], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:06:20.672918"], ["id", 1183]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1183], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.682926"], ["updated_at", "2019-04-08 10:06:20.682926"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:06:20.689330"], ["updated_at", "2019-04-08 10:06:20.689330"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.701072"], ["updated_at", "2019-04-08 10:06:20.701072"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:06:20.706971"], ["updated_at", "2019-04-08 10:06:20.706971"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.716232"], ["updated_at", "2019-04-08 10:06:20.716232"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:06:20.721536"], ["updated_at", "2019-04-08 10:06:20.721536"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:20.728054"], ["updated_at", "2019-04-08 10:06:20.728054"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:06:20.733045"], ["updated_at", "2019-04-08 10:06:20.733045"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:06:20.748602"], ["updated_at", "2019-04-08 10:06:20.748602"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631580"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1192], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:06:20.754294"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554890780"], ["id", 1192]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1192]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:06:20.765157"], ["updated_at", "2019-04-08 10:06:20.765157"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804380"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:06:20.772139"], ["updated_at", "2019-04-08 10:06:20.772139"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.9ms) ROLLBACK  (1.4ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:06:20.805910"], ["updated_at", "2019-04-08 10:06:20.805910"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (2.9ms) ROLLBACK  (1.2ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:06:20.838200"], ["updated_at", "2019-04-08 10:06:20.838200"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:06:20.843125"], ["updated_at", "2019-04-08 10:06:20.843125"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:06:20.846709"], ["updated_at", "2019-04-08 10:06:20.846709"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:06:20.856780"], ["updated_at", "2019-04-08 10:06:20.856780"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (1.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:06:20.860795"], ["synced_id", 0], ["id", 1199]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.873153"], ["updated_at", "2019-04-08 10:06:20.873153"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1200], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1200], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:06:20.883771"], ["id", 1200]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1200], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.892374"], ["updated_at", "2019-04-08 10:06:20.892374"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.896645"], ["updated_at", "2019-04-08 10:06:20.896645"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.908752"], ["updated_at", "2019-04-08 10:06:20.908752"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.914587"], ["updated_at", "2019-04-08 10:06:20.914587"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:06:20.923597"], ["updated_at", "2019-04-08 10:06:20.923597"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:06:20.937356"], ["updated_at", "2019-04-08 10:06:20.937356"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.941923"], ["updated_at", "2019-04-08 10:06:20.941923"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:06:20.951369"], ["updated_at", "2019-04-08 10:06:20.951369"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.955856"], ["updated_at", "2019-04-08 10:06:20.955856"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:06:20.965415"], ["updated_at", "2019-04-08 10:06:20.965415"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.970187"], ["updated_at", "2019-04-08 10:06:20.970187"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.977630"], ["updated_at", "2019-04-08 10:06:20.977630"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.981552"], ["updated_at", "2019-04-08 10:06:20.981552"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1303], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:06:20.986971"], ["id", 1303]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:20.996335"], ["updated_at", "2019-04-08 10:06:20.996335"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.001440"], ["updated_at", "2019-04-08 10:06:21.001440"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1305], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:06:21.008092"], ["id", 1305]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1305], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.017212"], ["updated_at", "2019-04-08 10:06:21.017212"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.021221"], ["updated_at", "2019-04-08 10:06:21.021221"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1307], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:06:21.026477"], ["id", 1307]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1307], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:21.037156"], ["updated_at", "2019-04-08 10:06:21.037156"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:21.041275"], ["updated_at", "2019-04-08 10:06:21.041275"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:21.047189"], ["updated_at", "2019-04-08 10:06:21.047189"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:21.051973"], ["updated_at", "2019-04-08 10:06:21.051973"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:06:21.061238"], ["updated_at", "2019-04-08 10:06:21.061238"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:06:21.069139"], ["updated_at", "2019-04-08 10:06:21.069139"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1314], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1314], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.7ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:06:21.075577"], ["id", 1314]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1314], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:21.086979"], ["updated_at", "2019-04-08 10:06:21.086979"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.095920"], ["updated_at", "2019-04-08 10:06:21.095920"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:21.106509"], ["updated_at", "2019-04-08 10:06:21.106509"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.115421"], ["updated_at", "2019-04-08 10:06:21.115421"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.123455"], ["updated_at", "2019-04-08 10:06:21.123455"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:06:21.132512"], ["updated_at", "2019-04-08 10:06:21.132512"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804381"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:06:21.139966"], ["updated_at", "2019-04-08 10:06:21.139966"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631581"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1318], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:06:21.144846"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554890781"], ["id", 1318]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1318]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:06:21.153982"], ["updated_at", "2019-04-08 10:06:21.153982"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.162663"], ["updated_at", "2019-04-08 10:06:21.162663"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:06:21.184535"], ["updated_at", "2019-04-08 10:06:21.184535"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:01.263128"], ["updated_at", "2019-04-08 10:12:01.263128"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.298602"], ["updated_at", "2019-04-08 10:12:01.298602"], ["synced_id", 123], ["host", "example.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.307312"], ["updated_at", "2019-04-08 10:12:01.307312"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.7ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.5ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.1ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:01.358537"], ["updated_at", "2019-04-08 10:12:01.358537"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 13ms (ActiveRecord: 5.7ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:01.377097"], ["updated_at", "2019-04-08 10:12:01.377097"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:01.399553"], ["updated_at", "2019-04-08 10:12:01.399553"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.0ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:01.422426"], ["updated_at", "2019-04-08 10:12:01.422426"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 5.5ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:01.453101"], ["updated_at", "2019-04-08 10:12:01.453101"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:01.458301"], ["updated_at", "2019-04-08 10:12:01.458301"], ["synced_id", 2]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:01.464917"], ["updated_at", "2019-04-08 10:12:01.464917"], ["synced_id", 3]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:01.482535"], ["updated_at", "2019-04-08 10:12:01.482535"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:01.520445"], ["updated_at", "2019-04-08 10:12:01.520445"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:01.531426"], ["updated_at", "2019-04-08 10:12:01.531426"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1210], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1210], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:12:01.550878"], ["id", 1210]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1210], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:01.562118"], ["updated_at", "2019-04-08 10:12:01.562118"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:12:01.578527"], ["updated_at", "2019-04-08 10:12:01.578527"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:12:01.584292"], ["synced_id", 0], ["id", 1212]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.604957"], ["updated_at", "2019-04-08 10:12:01.604957"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.612729"], ["updated_at", "2019-04-08 10:12:01.612729"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1214], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:01.620475"], ["id", 1214]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.628303"], ["updated_at", "2019-04-08 10:12:01.628303"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.633181"], ["updated_at", "2019-04-08 10:12:01.633181"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1216], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:01.639578"], ["id", 1216]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1216], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.649572"], ["updated_at", "2019-04-08 10:12:01.649572"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.654278"], ["updated_at", "2019-04-08 10:12:01.654278"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1218], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:01.660794"], ["id", 1218]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1218], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.669717"], ["updated_at", "2019-04-08 10:12:01.669717"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.674903"], ["updated_at", "2019-04-08 10:12:01.674903"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1220], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:01.680753"], ["id", 1220]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.687960"], ["updated_at", "2019-04-08 10:12:01.687960"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:01.694758"], ["updated_at", "2019-04-08 10:12:01.694758"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.702018"], ["updated_at", "2019-04-08 10:12:01.702018"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:01.707355"], ["updated_at", "2019-04-08 10:12:01.707355"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.715462"], ["updated_at", "2019-04-08 10:12:01.715462"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:01.722020"], ["updated_at", "2019-04-08 10:12:01.722020"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:01.729401"], ["updated_at", "2019-04-08 10:12:01.729401"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:01.736008"], ["updated_at", "2019-04-08 10:12:01.736008"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:01.760189"], ["updated_at", "2019-04-08 10:12:01.760189"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:01.769610"], ["updated_at", "2019-04-08 10:12:01.769610"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631921"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1229], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:12:01.778513"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891121"], ["id", 1229]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1229]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.8ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:01.795873"], ["updated_at", "2019-04-08 10:12:01.795873"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804721"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:01.817149"], ["updated_at", "2019-04-08 10:12:01.817149"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:01.863926"], ["updated_at", "2019-04-08 10:12:01.863926"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:01.891782"], ["updated_at", "2019-04-08 10:12:01.891782"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:01.933530"], ["updated_at", "2019-04-08 10:12:01.933530"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:01.952984"], ["updated_at", "2019-04-08 10:12:01.952984"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:01.972173"], ["updated_at", "2019-04-08 10:12:01.972173"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.018128"], ["updated_at", "2019-04-08 10:12:02.018128"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (2.5ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:02.035022"], ["updated_at", "2019-04-08 10:12:02.035022"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (3.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.051012"], ["updated_at", "2019-04-08 10:12:02.051012"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.2ms) RELEASE SAVEPOINT active_record_1 Application Load (2.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.4ms) ROLLBACK  (2.3ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.078503"], ["updated_at", "2019-04-08 10:12:02.078503"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (2.0ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:12:02.115614"], ["updated_at", "2019-04-08 10:12:02.115614"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631922"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1327], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:12:02.123840"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891122"], ["id", 1327]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1327]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:12:02.138279"], ["updated_at", "2019-04-08 10:12:02.138279"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804722"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:02.147673"], ["updated_at", "2019-04-08 10:12:02.147673"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:02.151764"], ["updated_at", "2019-04-08 10:12:02.151764"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:02.155787"], ["updated_at", "2019-04-08 10:12:02.155787"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:02.160923"], ["updated_at", "2019-04-08 10:12:02.160923"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.169741"], ["updated_at", "2019-04-08 10:12:02.169741"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.175271"], ["updated_at", "2019-04-08 10:12:02.175271"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1333], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:02.185254"], ["id", 1333]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.195020"], ["updated_at", "2019-04-08 10:12:02.195020"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.200369"], ["updated_at", "2019-04-08 10:12:02.200369"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1335], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:02.205929"], ["id", 1335]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1335], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.216096"], ["updated_at", "2019-04-08 10:12:02.216096"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.220022"], ["updated_at", "2019-04-08 10:12:02.220022"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1337], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:02.225109"], ["id", 1337]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1337], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.233527"], ["updated_at", "2019-04-08 10:12:02.233527"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.237227"], ["updated_at", "2019-04-08 10:12:02.237227"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:02.243970"], ["updated_at", "2019-04-08 10:12:02.243970"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.4ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:02.259725"], ["updated_at", "2019-04-08 10:12:02.259725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.265370"], ["updated_at", "2019-04-08 10:12:02.265370"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:02.274956"], ["updated_at", "2019-04-08 10:12:02.274956"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.280524"], ["updated_at", "2019-04-08 10:12:02.280524"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:02.288281"], ["updated_at", "2019-04-08 10:12:02.288281"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.293278"], ["updated_at", "2019-04-08 10:12:02.293278"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.301369"], ["updated_at", "2019-04-08 10:12:02.301369"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.305339"], ["updated_at", "2019-04-08 10:12:02.305339"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:02.315383"], ["updated_at", "2019-04-08 10:12:02.315383"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1350], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1350], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:12:02.320873"], ["id", 1350]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1350], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:02.331912"], ["updated_at", "2019-04-08 10:12:02.331912"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.339996"], ["updated_at", "2019-04-08 10:12:02.339996"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:02.365255"], ["updated_at", "2019-04-08 10:12:02.365255"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:02.372231"], ["updated_at", "2019-04-08 10:12:02.372231"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.378244"], ["updated_at", "2019-04-08 10:12:02.378244"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:02.383460"], ["updated_at", "2019-04-08 10:12:02.383460"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:46.410041"], ["updated_at", "2019-04-08 10:12:46.410041"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 36ms (ActiveRecord: 11.1ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:46.420684"], ["updated_at", "2019-04-08 10:12:46.420684"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 2.8ms)  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:46.434937"], ["updated_at", "2019-04-08 10:12:46.434937"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 7.6ms)  (1.3ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:46.474932"], ["updated_at", "2019-04-08 10:12:46.474932"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 7.0ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:46.557895"], ["updated_at", "2019-04-08 10:12:46.557895"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.574002"], ["updated_at", "2019-04-08 10:12:46.574002"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.579331"], ["updated_at", "2019-04-08 10:12:46.579331"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:46.592039"], ["updated_at", "2019-04-08 10:12:46.592039"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:46.608965"], ["updated_at", "2019-04-08 10:12:46.608965"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:46.637131"], ["updated_at", "2019-04-08 10:12:46.637131"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:46.651172"], ["updated_at", "2019-04-08 10:12:46.651172"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:46.665214"], ["updated_at", "2019-04-08 10:12:46.665214"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:46.688416"], ["updated_at", "2019-04-08 10:12:46.688416"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:46.710382"], ["updated_at", "2019-04-08 10:12:46.710382"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.727714"], ["updated_at", "2019-04-08 10:12:46.727714"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.734993"], ["updated_at", "2019-04-08 10:12:46.734993"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1236], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:46.743787"], ["id", 1236]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.755544"], ["updated_at", "2019-04-08 10:12:46.755544"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.760366"], ["updated_at", "2019-04-08 10:12:46.760366"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1238], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:46.767229"], ["id", 1238]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1238], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.775651"], ["updated_at", "2019-04-08 10:12:46.775651"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.779888"], ["updated_at", "2019-04-08 10:12:46.779888"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1240], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:46.785956"], ["id", 1240]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1240], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.794279"], ["updated_at", "2019-04-08 10:12:46.794279"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.798087"], ["updated_at", "2019-04-08 10:12:46.798087"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1242], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:46.803779"], ["id", 1242]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.810538"], ["updated_at", "2019-04-08 10:12:46.810538"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:46.817042"], ["updated_at", "2019-04-08 10:12:46.817042"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.824904"], ["updated_at", "2019-04-08 10:12:46.824904"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:46.830188"], ["updated_at", "2019-04-08 10:12:46.830188"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.838049"], ["updated_at", "2019-04-08 10:12:46.838049"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:46.848836"], ["updated_at", "2019-04-08 10:12:46.848836"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:46.857971"], ["updated_at", "2019-04-08 10:12:46.857971"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:12:46.864317"], ["updated_at", "2019-04-08 10:12:46.864317"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:46.874119"], ["updated_at", "2019-04-08 10:12:46.874119"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:46.884351"], ["updated_at", "2019-04-08 10:12:46.884351"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:46.911745"], ["updated_at", "2019-04-08 10:12:46.911745"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631966"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1252], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:12:46.917098"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891166"], ["id", 1252]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1252]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:46.926748"], ["updated_at", "2019-04-08 10:12:46.926748"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804766"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (3.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:46.939730"], ["updated_at", "2019-04-08 10:12:46.939730"], ["synced_id", 1]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:46.947157"], ["updated_at", "2019-04-08 10:12:46.947157"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:46.951138"], ["updated_at", "2019-04-08 10:12:46.951138"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:12:46.962930"], ["updated_at", "2019-04-08 10:12:46.962930"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (2.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:12:46.967890"], ["synced_id", 0], ["id", 1257]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (2.3ms) ROLLBACK  (1.4ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:46.992798"], ["updated_at", "2019-04-08 10:12:46.992798"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (0.9ms) BEGIN  (1.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:12:47.025097"], ["updated_at", "2019-04-08 10:12:47.025097"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.9ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Account Exists (3.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.042382"], ["updated_at", "2019-04-08 10:12:47.042382"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1260], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1260], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:12:47.051025"], ["id", 1260]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1260], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.061441"], ["updated_at", "2019-04-08 10:12:47.061441"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.070349"], ["updated_at", "2019-04-08 10:12:47.070349"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1358], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:47.088053"], ["id", 1358]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.102020"], ["updated_at", "2019-04-08 10:12:47.102020"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.109213"], ["updated_at", "2019-04-08 10:12:47.109213"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1360], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:47.118043"], ["id", 1360]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1360], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.129517"], ["updated_at", "2019-04-08 10:12:47.129517"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.138485"], ["updated_at", "2019-04-08 10:12:47.138485"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1362], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:12:47.146642"], ["id", 1362]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1362], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.157883"], ["updated_at", "2019-04-08 10:12:47.157883"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.162551"], ["updated_at", "2019-04-08 10:12:47.162551"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:47.170041"], ["updated_at", "2019-04-08 10:12:47.170041"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:47.179986"], ["updated_at", "2019-04-08 10:12:47.179986"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.185165"], ["updated_at", "2019-04-08 10:12:47.185165"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:47.193962"], ["updated_at", "2019-04-08 10:12:47.193962"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.198486"], ["updated_at", "2019-04-08 10:12:47.198486"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:12:47.208046"], ["updated_at", "2019-04-08 10:12:47.208046"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.212863"], ["updated_at", "2019-04-08 10:12:47.212863"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.221718"], ["updated_at", "2019-04-08 10:12:47.221718"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.226978"], ["updated_at", "2019-04-08 10:12:47.226978"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:47.242045"], ["updated_at", "2019-04-08 10:12:47.242045"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.0ms) BEGIN Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:47.262396"], ["updated_at", "2019-04-08 10:12:47.262396"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.277357"], ["updated_at", "2019-04-08 10:12:47.277357"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.285983"], ["updated_at", "2019-04-08 10:12:47.285983"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:12:47.295504"], ["updated_at", "2019-04-08 10:12:47.295504"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804767"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:12:47.311790"], ["updated_at", "2019-04-08 10:12:47.311790"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631967"], ["host", "example.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1378], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:12:47.324368"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891167"], ["id", 1378]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (2.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1378]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.8ms) ROLLBACK  (1.2ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.352649"], ["updated_at", "2019-04-08 10:12:47.352649"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:12:47.377411"], ["updated_at", "2019-04-08 10:12:47.377411"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1380], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1380], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:12:47.385172"], ["id", 1380]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1380], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:47.395705"], ["updated_at", "2019-04-08 10:12:47.395705"], ["synced_id", 123], ["host", "test.example"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.414587"], ["updated_at", "2019-04-08 10:12:47.414587"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Application Load (2.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.9ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:47.436656"], ["updated_at", "2019-04-08 10:12:47.436656"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:12:47.447905"], ["updated_at", "2019-04-08 10:12:47.447905"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:47.479258"], ["updated_at", "2019-04-08 10:12:47.479258"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:47.485691"], ["updated_at", "2019-04-08 10:12:47.485691"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:47.491471"], ["updated_at", "2019-04-08 10:12:47.491471"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:12:47.498022"], ["updated_at", "2019-04-08 10:12:47.498022"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:17.304451"], ["updated_at", "2019-04-08 10:13:17.304451"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:17.329885"], ["updated_at", "2019-04-08 10:13:17.329885"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:17.348805"], ["updated_at", "2019-04-08 10:13:17.348805"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.376106"], ["updated_at", "2019-04-08 10:13:17.376106"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1263], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1263], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:13:17.396335"], ["id", 1263]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1263], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:17.409981"], ["updated_at", "2019-04-08 10:13:17.409981"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631997"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1264], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:13:17.415731"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891197"], ["id", 1264]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1264]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:17.427019"], ["updated_at", "2019-04-08 10:13:17.427019"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804797"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (2.0ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:17.446904"], ["updated_at", "2019-04-08 10:13:17.446904"], ["synced_id", 1]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:17.455343"], ["updated_at", "2019-04-08 10:13:17.455343"], ["synced_id", 2]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:17.460544"], ["updated_at", "2019-04-08 10:13:17.460544"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:13:17.475005"], ["updated_at", "2019-04-08 10:13:17.475005"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 Account Update (2.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:13:17.481026"], ["synced_id", 0], ["id", 1269]]  (2.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (3.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:17.507624"], ["updated_at", "2019-04-08 10:13:17.507624"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.540456"], ["updated_at", "2019-04-08 10:13:17.540456"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.546838"], ["updated_at", "2019-04-08 10:13:17.546838"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1272], ["LIMIT", 1]] Account Update (2.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:17.562285"], ["id", 1272]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1272], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.577747"], ["updated_at", "2019-04-08 10:13:17.577747"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.583294"], ["updated_at", "2019-04-08 10:13:17.583294"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1274], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:17.589910"], ["id", 1274]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1274], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.600131"], ["updated_at", "2019-04-08 10:13:17.600131"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.604620"], ["updated_at", "2019-04-08 10:13:17.604620"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1276], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:17.610505"], ["id", 1276]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.619533"], ["updated_at", "2019-04-08 10:13:17.619533"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.623529"], ["updated_at", "2019-04-08 10:13:17.623529"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1278], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:17.629479"], ["id", 1278]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.637205"], ["updated_at", "2019-04-08 10:13:17.637205"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:17.643332"], ["updated_at", "2019-04-08 10:13:17.643332"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.651507"], ["updated_at", "2019-04-08 10:13:17.651507"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:17.656193"], ["updated_at", "2019-04-08 10:13:17.656193"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.663436"], ["updated_at", "2019-04-08 10:13:17.663436"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:17.668931"], ["updated_at", "2019-04-08 10:13:17.668931"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:17.675594"], ["updated_at", "2019-04-08 10:13:17.675594"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:17.681594"], ["updated_at", "2019-04-08 10:13:17.681594"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:17.710468"], ["updated_at", "2019-04-08 10:13:17.710468"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:17.724229"], ["updated_at", "2019-04-08 10:13:17.724229"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.3ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:17.737062"], ["updated_at", "2019-04-08 10:13:17.737062"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (1.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:17.755960"], ["updated_at", "2019-04-08 10:13:17.755960"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 4.8ms)  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.821795"], ["updated_at", "2019-04-08 10:13:17.821795"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.843795"], ["updated_at", "2019-04-08 10:13:17.843795"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.857654"], ["updated_at", "2019-04-08 10:13:17.857654"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.877110"], ["updated_at", "2019-04-08 10:13:17.877110"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.896794"], ["updated_at", "2019-04-08 10:13:17.896794"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.910593"], ["updated_at", "2019-04-08 10:13:17.910593"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.924301"], ["updated_at", "2019-04-08 10:13:17.924301"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.933442"], ["updated_at", "2019-04-08 10:13:17.933442"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.937291"], ["updated_at", "2019-04-08 10:13:17.937291"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1389], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:17.942615"], ["id", 1389]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.952002"], ["updated_at", "2019-04-08 10:13:17.952002"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.960350"], ["updated_at", "2019-04-08 10:13:17.960350"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1391], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:17.967330"], ["id", 1391]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1391], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.977540"], ["updated_at", "2019-04-08 10:13:17.977540"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:17.984982"], ["updated_at", "2019-04-08 10:13:17.984982"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1393], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:17.992117"], ["id", 1393]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1393], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.003065"], ["updated_at", "2019-04-08 10:13:18.003065"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.007304"], ["updated_at", "2019-04-08 10:13:18.007304"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:18.014816"], ["updated_at", "2019-04-08 10:13:18.014816"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:18.025521"], ["updated_at", "2019-04-08 10:13:18.025521"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.030197"], ["updated_at", "2019-04-08 10:13:18.030197"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:18.037736"], ["updated_at", "2019-04-08 10:13:18.037736"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.041438"], ["updated_at", "2019-04-08 10:13:18.041438"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:18.049250"], ["updated_at", "2019-04-08 10:13:18.049250"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.052988"], ["updated_at", "2019-04-08 10:13:18.052988"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.059567"], ["updated_at", "2019-04-08 10:13:18.059567"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.064047"], ["updated_at", "2019-04-08 10:13:18.064047"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.071511"], ["updated_at", "2019-04-08 10:13:18.071511"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.077124"], ["updated_at", "2019-04-08 10:13:18.077124"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:18.100326"], ["updated_at", "2019-04-08 10:13:18.100326"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.107426"], ["updated_at", "2019-04-08 10:13:18.107426"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.121921"], ["updated_at", "2019-04-08 10:13:18.121921"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.127572"], ["updated_at", "2019-04-08 10:13:18.127572"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.138403"], ["updated_at", "2019-04-08 10:13:18.138403"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.144638"], ["updated_at", "2019-04-08 10:13:18.144638"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:18.151422"], ["updated_at", "2019-04-08 10:13:18.151422"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:13:18.159023"], ["updated_at", "2019-04-08 10:13:18.159023"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554631998"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1411], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:13:18.164116"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891198"], ["id", 1411]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1411]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:13:18.174743"], ["updated_at", "2019-04-08 10:13:18.174743"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804798"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.4ms) BEGIN Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:18.192264"], ["updated_at", "2019-04-08 10:13:18.192264"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1413], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1413], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:13:18.198399"], ["id", 1413]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1413], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.206738"], ["updated_at", "2019-04-08 10:13:18.206738"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.210738"], ["updated_at", "2019-04-08 10:13:18.210738"], ["synced_id", 2], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.221044"], ["updated_at", "2019-04-08 10:13:18.221044"], ["synced_id", 1], ["host", "example2.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.231426"], ["updated_at", "2019-04-08 10:13:18.231426"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:18.252729"], ["updated_at", "2019-04-08 10:13:18.252729"], ["synced_id", 123]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.270700"], ["updated_at", "2019-04-08 10:13:18.270700"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:18.276946"], ["updated_at", "2019-04-08 10:13:18.276946"], ["synced_id", 123], ["host", "test.host"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (2.0ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:45.948025"], ["updated_at", "2019-04-08 10:13:45.948025"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:45.987466"], ["updated_at", "2019-04-08 10:13:45.987466"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.006406"], ["updated_at", "2019-04-08 10:13:46.006406"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.030684"], ["updated_at", "2019-04-08 10:13:46.030684"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.045922"], ["updated_at", "2019-04-08 10:13:46.045922"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.059422"], ["updated_at", "2019-04-08 10:13:46.059422"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.085165"], ["updated_at", "2019-04-08 10:13:46.085165"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.119932"], ["updated_at", "2019-04-08 10:13:46.119932"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.128925"], ["updated_at", "2019-04-08 10:13:46.128925"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.157065"], ["updated_at", "2019-04-08 10:13:46.157065"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.161517"], ["updated_at", "2019-04-08 10:13:46.161517"], ["synced_id", 2], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.167761"], ["updated_at", "2019-04-08 10:13:46.167761"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.173108"], ["updated_at", "2019-04-08 10:13:46.173108"], ["synced_id", 2], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.186222"], ["updated_at", "2019-04-08 10:13:46.186222"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.195000"], ["updated_at", "2019-04-08 10:13:46.195000"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.206171"], ["updated_at", "2019-04-08 10:13:46.206171"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.223743"], ["updated_at", "2019-04-08 10:13:46.223743"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.230643"], ["updated_at", "2019-04-08 10:13:46.230643"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.236814"], ["updated_at", "2019-04-08 10:13:46.236814"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:46.251546"], ["updated_at", "2019-04-08 10:13:46.251546"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:46.266231"], ["updated_at", "2019-04-08 10:13:46.266231"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1429], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1429], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:13:46.276159"], ["id", 1429]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1429], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.285428"], ["updated_at", "2019-04-08 10:13:46.285428"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.289469"], ["updated_at", "2019-04-08 10:13:46.289469"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.300601"], ["updated_at", "2019-04-08 10:13:46.300601"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.310244"], ["updated_at", "2019-04-08 10:13:46.310244"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1432], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:46.319214"], ["id", 1432]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.333546"], ["updated_at", "2019-04-08 10:13:46.333546"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.348814"], ["updated_at", "2019-04-08 10:13:46.348814"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1434], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:46.364325"], ["id", 1434]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1434], ["LIMIT", 1]]  (2.5ms) ROLLBACK  (1.4ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.385357"], ["updated_at", "2019-04-08 10:13:46.385357"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.391516"], ["updated_at", "2019-04-08 10:13:46.391516"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1436], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:46.399076"], ["id", 1436]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1436], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.409179"], ["updated_at", "2019-04-08 10:13:46.409179"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.415191"], ["updated_at", "2019-04-08 10:13:46.415191"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:46.423069"], ["updated_at", "2019-04-08 10:13:46.423069"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:46.433688"], ["updated_at", "2019-04-08 10:13:46.433688"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.439546"], ["updated_at", "2019-04-08 10:13:46.439546"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:46.450512"], ["updated_at", "2019-04-08 10:13:46.450512"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.455652"], ["updated_at", "2019-04-08 10:13:46.455652"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:46.464745"], ["updated_at", "2019-04-08 10:13:46.464745"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.469128"], ["updated_at", "2019-04-08 10:13:46.469128"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:13:46.476983"], ["updated_at", "2019-04-08 10:13:46.476983"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632026"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1447], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:13:46.483094"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891226"], ["id", 1447]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1447]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:13:46.499425"], ["updated_at", "2019-04-08 10:13:46.499425"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804826"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:46.554829"], ["updated_at", "2019-04-08 10:13:46.554829"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:46.565618"], ["updated_at", "2019-04-08 10:13:46.565618"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:46.574308"], ["updated_at", "2019-04-08 10:13:46.574308"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:13:46.583968"], ["updated_at", "2019-04-08 10:13:46.583968"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1293], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1293], ["LIMIT", 1]] Account Update (2.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:13:46.598430"], ["id", 1293]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1293], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.4ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:46.617600"], ["updated_at", "2019-04-08 10:13:46.617600"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554804826"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:13:46.630105"], ["updated_at", "2019-04-08 10:13:46.630105"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632026"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1295], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:13:46.638515"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891226"], ["id", 1295]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.8ms) SAVEPOINT active_record_1 Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1295]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.653627"], ["updated_at", "2019-04-08 10:13:46.653627"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.658622"], ["updated_at", "2019-04-08 10:13:46.658622"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1297], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:46.666130"], ["id", 1297]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.674458"], ["updated_at", "2019-04-08 10:13:46.674458"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.678922"], ["updated_at", "2019-04-08 10:13:46.678922"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1299], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:46.684736"], ["id", 1299]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1299], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.692734"], ["updated_at", "2019-04-08 10:13:46.692734"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.696781"], ["updated_at", "2019-04-08 10:13:46.696781"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1301], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:46.702470"], ["id", 1301]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1301], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.711923"], ["updated_at", "2019-04-08 10:13:46.711923"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.717186"], ["updated_at", "2019-04-08 10:13:46.717186"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1303], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:13:46.722483"], ["id", 1303]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.732407"], ["updated_at", "2019-04-08 10:13:46.732407"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:46.745837"], ["updated_at", "2019-04-08 10:13:46.745837"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.755832"], ["updated_at", "2019-04-08 10:13:46.755832"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:46.761780"], ["updated_at", "2019-04-08 10:13:46.761780"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.777524"], ["updated_at", "2019-04-08 10:13:46.777524"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:46.786871"], ["updated_at", "2019-04-08 10:13:46.786871"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:46.799283"], ["updated_at", "2019-04-08 10:13:46.799283"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:46.811876"], ["updated_at", "2019-04-08 10:13:46.811876"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:46.824239"], ["updated_at", "2019-04-08 10:13:46.824239"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:46.853462"], ["updated_at", "2019-04-08 10:13:46.853462"], ["synced_id", 1]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:46.860191"], ["updated_at", "2019-04-08 10:13:46.860191"], ["synced_id", 2]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:46.867371"], ["updated_at", "2019-04-08 10:13:46.867371"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:13:46.882564"], ["updated_at", "2019-04-08 10:13:46.882564"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:13:46.886585"], ["synced_id", 0], ["id", 1316]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (1.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:46.969297"], ["updated_at", "2019-04-08 10:13:46.969297"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:46.984090"], ["updated_at", "2019-04-08 10:13:46.984090"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.2ms)  (1.4ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:13:47.003073"], ["updated_at", "2019-04-08 10:13:47.003073"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:13:47.020335"], ["updated_at", "2019-04-08 10:13:47.020335"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.2ms)  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:47.038223"], ["updated_at", "2019-04-08 10:13:47.038223"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:13:47.042180"], ["updated_at", "2019-04-08 10:13:47.042180"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:13:47.057008"], ["updated_at", "2019-04-08 10:13:47.057008"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.5ms) BEGIN  (2.3ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:49.848604"], ["updated_at", "2019-04-08 10:17:49.848604"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:49.856107"], ["updated_at", "2019-04-08 10:17:49.856107"], ["synced_id", 123], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:17:49.884858"], ["updated_at", "2019-04-08 10:17:49.884858"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:49.904996"], ["updated_at", "2019-04-08 10:17:49.904996"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1322], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1322], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:17:49.918003"], ["id", 1322]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1322], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:49.928028"], ["updated_at", "2019-04-08 10:17:49.928028"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:17:49.936507"], ["updated_at", "2019-04-08 10:17:49.936507"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:49.950019"], ["updated_at", "2019-04-08 10:17:49.950019"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:17:49.963176"], ["updated_at", "2019-04-08 10:17:49.963176"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:49.975925"], ["updated_at", "2019-04-08 10:17:49.975925"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:17:49.988172"], ["updated_at", "2019-04-08 10:17:49.988172"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.001326"], ["updated_at", "2019-04-08 10:17:50.001326"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:17:50.008970"], ["updated_at", "2019-04-08 10:17:50.008970"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.019226"], ["updated_at", "2019-04-08 10:17:50.019226"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.024156"], ["updated_at", "2019-04-08 10:17:50.024156"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1332], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:17:50.031274"], ["id", 1332]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.038846"], ["updated_at", "2019-04-08 10:17:50.038846"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.043713"], ["updated_at", "2019-04-08 10:17:50.043713"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1334], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:17:50.049864"], ["id", 1334]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.057877"], ["updated_at", "2019-04-08 10:17:50.057877"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.064578"], ["updated_at", "2019-04-08 10:17:50.064578"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1336], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:17:50.078511"], ["id", 1336]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1336], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.088302"], ["updated_at", "2019-04-08 10:17:50.088302"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.093860"], ["updated_at", "2019-04-08 10:17:50.093860"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1338], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:17:50.099592"], ["id", 1338]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1338], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:17:50.112957"], ["updated_at", "2019-04-08 10:17:50.112957"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:17:50.116494"], ["synced_id", 0], ["id", 1339]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:17:50.133090"], ["updated_at", "2019-04-08 10:17:50.133090"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:17:50.141460"], ["updated_at", "2019-04-08 10:17:50.141460"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805070"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:17:50.148633"], ["updated_at", "2019-04-08 10:17:50.148633"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632270"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1342], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:17:50.153956"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891470"], ["id", 1342]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (1.1ms) SAVEPOINT active_record_1 Account Destroy (2.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1342]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:17:50.172552"], ["updated_at", "2019-04-08 10:17:50.172552"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:17:50.179734"], ["updated_at", "2019-04-08 10:17:50.179734"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:17:50.186716"], ["updated_at", "2019-04-08 10:17:50.186716"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:17:50.190467"], ["updated_at", "2019-04-08 10:17:50.190467"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:17:50.196050"], ["updated_at", "2019-04-08 10:17:50.196050"], ["synced_id", 3]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (2.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (2.0ms) ROLLBACK  (1.4ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:17:50.216537"], ["updated_at", "2019-04-08 10:17:50.216537"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.318068"], ["updated_at", "2019-04-08 10:17:50.318068"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.337267"], ["updated_at", "2019-04-08 10:17:50.337267"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.368945"], ["updated_at", "2019-04-08 10:17:50.368945"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.386058"], ["updated_at", "2019-04-08 10:17:50.386058"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.407630"], ["updated_at", "2019-04-08 10:17:50.407630"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.439355"], ["updated_at", "2019-04-08 10:17:50.439355"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.466606"], ["updated_at", "2019-04-08 10:17:50.466606"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.474481"], ["updated_at", "2019-04-08 10:17:50.474481"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.482085"], ["updated_at", "2019-04-08 10:17:50.482085"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:17:50.494192"], ["updated_at", "2019-04-08 10:17:50.494192"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1457], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1457], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:17:50.503041"], ["id", 1457]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1457], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:17:50.513261"], ["updated_at", "2019-04-08 10:17:50.513261"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805070"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:17:50.522094"], ["updated_at", "2019-04-08 10:17:50.522094"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632270"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1459], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:17:50.532164"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891470"], ["id", 1459]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1459]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.545562"], ["updated_at", "2019-04-08 10:17:50.545562"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.560496"], ["updated_at", "2019-04-08 10:17:50.560496"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (3.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.614253"], ["updated_at", "2019-04-08 10:17:50.614253"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.640874"], ["updated_at", "2019-04-08 10:17:50.640874"], ["synced_id", 1], ["host", "example.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.653578"], ["updated_at", "2019-04-08 10:17:50.653578"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.659070"], ["updated_at", "2019-04-08 10:17:50.659070"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.666354"], ["updated_at", "2019-04-08 10:17:50.666354"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:17:50.678963"], ["updated_at", "2019-04-08 10:17:50.678963"], ["synced_id", 123], ["host", "test.example"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.697078"], ["updated_at", "2019-04-08 10:17:50.697078"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.710113"], ["updated_at", "2019-04-08 10:17:50.710113"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.715115"], ["updated_at", "2019-04-08 10:17:50.715115"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:17:50.724715"], ["updated_at", "2019-04-08 10:17:50.724715"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:17:50.735041"], ["updated_at", "2019-04-08 10:17:50.735041"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.740225"], ["updated_at", "2019-04-08 10:17:50.740225"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:17:50.750107"], ["updated_at", "2019-04-08 10:17:50.750107"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.754865"], ["updated_at", "2019-04-08 10:17:50.754865"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:17:50.764832"], ["updated_at", "2019-04-08 10:17:50.764832"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.769627"], ["updated_at", "2019-04-08 10:17:50.769627"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.776976"], ["updated_at", "2019-04-08 10:17:50.776976"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.781060"], ["updated_at", "2019-04-08 10:17:50.781060"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1476], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:17:50.786762"], ["id", 1476]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.794227"], ["updated_at", "2019-04-08 10:17:50.794227"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.798098"], ["updated_at", "2019-04-08 10:17:50.798098"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1478], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:17:50.803578"], ["id", 1478]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1478], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.811316"], ["updated_at", "2019-04-08 10:17:50.811316"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.816430"], ["updated_at", "2019-04-08 10:17:50.816430"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1480], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:17:50.821647"], ["id", 1480]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1480], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.829713"], ["updated_at", "2019-04-08 10:17:50.829713"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.835167"], ["updated_at", "2019-04-08 10:17:50.835167"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:17:50.847885"], ["updated_at", "2019-04-08 10:17:50.847885"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (2.4ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:17:50.881762"], ["updated_at", "2019-04-08 10:17:50.881762"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.5ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:17:50.895397"], ["updated_at", "2019-04-08 10:17:50.895397"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 5.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:17:50.913696"], ["updated_at", "2019-04-08 10:17:50.913696"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.6ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:17:50.933050"], ["updated_at", "2019-04-08 10:17:50.933050"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:17:50.973382"], ["updated_at", "2019-04-08 10:17:50.973382"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.338296"], ["updated_at", "2019-04-08 10:19:11.338296"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.400077"], ["updated_at", "2019-04-08 10:19:11.400077"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.409900"], ["updated_at", "2019-04-08 10:19:11.409900"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.444717"], ["updated_at", "2019-04-08 10:19:11.444717"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.452604"], ["updated_at", "2019-04-08 10:19:11.452604"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.463426"], ["updated_at", "2019-04-08 10:19:11.463426"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.467654"], ["updated_at", "2019-04-08 10:19:11.467654"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.476512"], ["updated_at", "2019-04-08 10:19:11.476512"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.480285"], ["updated_at", "2019-04-08 10:19:11.480285"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:11.488577"], ["updated_at", "2019-04-08 10:19:11.488577"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:11.497641"], ["updated_at", "2019-04-08 10:19:11.497641"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.501664"], ["updated_at", "2019-04-08 10:19:11.501664"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:11.510441"], ["updated_at", "2019-04-08 10:19:11.510441"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.514513"], ["updated_at", "2019-04-08 10:19:11.514513"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:11.521687"], ["updated_at", "2019-04-08 10:19:11.521687"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.525983"], ["updated_at", "2019-04-08 10:19:11.525983"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.533123"], ["updated_at", "2019-04-08 10:19:11.533123"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.536683"], ["updated_at", "2019-04-08 10:19:11.536683"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1499], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:11.542424"], ["id", 1499]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.548672"], ["updated_at", "2019-04-08 10:19:11.548672"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.552075"], ["updated_at", "2019-04-08 10:19:11.552075"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1501], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:11.556380"], ["id", 1501]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1501], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.564453"], ["updated_at", "2019-04-08 10:19:11.564453"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.568151"], ["updated_at", "2019-04-08 10:19:11.568151"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1503], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:11.573243"], ["id", 1503]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1503], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:19:11.582630"], ["updated_at", "2019-04-08 10:19:11.582630"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805151"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:19:11.589748"], ["updated_at", "2019-04-08 10:19:11.589748"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632351"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1506], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:19:11.595489"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891551"], ["id", 1506]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1506]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (2.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.618583"], ["updated_at", "2019-04-08 10:19:11.618583"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.627843"], ["updated_at", "2019-04-08 10:19:11.627843"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.635245"], ["updated_at", "2019-04-08 10:19:11.635245"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (2.4ms) BEGIN  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:11.651874"], ["updated_at", "2019-04-08 10:19:11.651874"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1508], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1508], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:19:11.664157"], ["id", 1508]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1508], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:11.676318"], ["updated_at", "2019-04-08 10:19:11.676318"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.3ms) BEGIN  (2.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.693424"], ["updated_at", "2019-04-08 10:19:11.693424"], ["synced_id", 1], ["host", "example.test"]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (2.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.704933"], ["updated_at", "2019-04-08 10:19:11.704933"], ["synced_id", 2], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.713763"], ["updated_at", "2019-04-08 10:19:11.713763"], ["synced_id", 1], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.724731"], ["updated_at", "2019-04-08 10:19:11.724731"], ["synced_id", 2], ["host", "example2.test"]]  (1.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.746136"], ["updated_at", "2019-04-08 10:19:11.746136"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (1.6ms) BEGIN  (3.2ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.812464"], ["updated_at", "2019-04-08 10:19:11.812464"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.837163"], ["updated_at", "2019-04-08 10:19:11.837163"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.855109"], ["updated_at", "2019-04-08 10:19:11.855109"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.882606"], ["updated_at", "2019-04-08 10:19:11.882606"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.920962"], ["updated_at", "2019-04-08 10:19:11.920962"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Application Load (4.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (3.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:11.966287"], ["updated_at", "2019-04-08 10:19:11.966287"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:11.997315"], ["updated_at", "2019-04-08 10:19:11.997315"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:12.006177"], ["updated_at", "2019-04-08 10:19:12.006177"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.016309"], ["updated_at", "2019-04-08 10:19:12.016309"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:12.024804"], ["updated_at", "2019-04-08 10:19:12.024804"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.041786"], ["updated_at", "2019-04-08 10:19:12.041786"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:12.049555"], ["updated_at", "2019-04-08 10:19:12.049555"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (2.9ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.064752"], ["updated_at", "2019-04-08 10:19:12.064752"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:12.073367"], ["updated_at", "2019-04-08 10:19:12.073367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.090838"], ["updated_at", "2019-04-08 10:19:12.090838"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.6ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.104454"], ["updated_at", "2019-04-08 10:19:12.104454"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1360], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:12.113629"], ["id", 1360]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.1ms) BEGIN  (3.1ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.130746"], ["updated_at", "2019-04-08 10:19:12.130746"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.138702"], ["updated_at", "2019-04-08 10:19:12.138702"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1362], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:12.146545"], ["id", 1362]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.163266"], ["updated_at", "2019-04-08 10:19:12.163266"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.170827"], ["updated_at", "2019-04-08 10:19:12.170827"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1364], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:12.178589"], ["id", 1364]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1364], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (2.8ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.197136"], ["updated_at", "2019-04-08 10:19:12.197136"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.205014"], ["updated_at", "2019-04-08 10:19:12.205014"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1366], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:12.212710"], ["id", 1366]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1366], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.4ms) BEGIN  (3.6ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:12.231117"], ["updated_at", "2019-04-08 10:19:12.231117"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN Account Load (2.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (2.8ms) SAVEPOINT active_record_1 Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:19:12.257172"], ["updated_at", "2019-04-08 10:19:12.257172"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Update (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:19:12.263841"], ["synced_id", 0], ["id", 1368]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:12.278705"], ["updated_at", "2019-04-08 10:19:12.278705"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632352"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1369], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:19:12.284621"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891552"], ["id", 1369]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.9ms) SAVEPOINT active_record_1 Account Destroy (2.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1369]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:12.301254"], ["updated_at", "2019-04-08 10:19:12.301254"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805152"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.5ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 Account Exists (4.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:12.318775"], ["updated_at", "2019-04-08 10:19:12.318775"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1371], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1371], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:19:12.329377"], ["id", 1371]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1371], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:12.339610"], ["updated_at", "2019-04-08 10:19:12.339610"], ["synced_id", 123]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:12.370985"], ["updated_at", "2019-04-08 10:19:12.370985"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (1.6ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:12.388683"], ["updated_at", "2019-04-08 10:19:12.388683"], ["synced_id", 1]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:12.397009"], ["updated_at", "2019-04-08 10:19:12.397009"], ["synced_id", 2]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:12.403369"], ["updated_at", "2019-04-08 10:19:12.403369"], ["synced_id", 3]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:12.423117"], ["updated_at", "2019-04-08 10:19:12.423117"], ["synced_id", 123]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.452058"], ["updated_at", "2019-04-08 10:19:12.452058"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:12.460086"], ["updated_at", "2019-04-08 10:19:12.460086"], ["synced_id", 123], ["host", "test.host"]]  (2.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:12.481656"], ["updated_at", "2019-04-08 10:19:12.481656"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.1ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (2.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.6ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 3ms (ActiveRecord: 0.0ms)  (2.5ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (1.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:12.563510"], ["updated_at", "2019-04-08 10:19:12.563510"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 6.3ms)  (1.0ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:12.579163"], ["updated_at", "2019-04-08 10:19:12.579163"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:12.599895"], ["updated_at", "2019-04-08 10:19:12.599895"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 9.5ms)  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 Account Exists (3.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:12.632567"], ["updated_at", "2019-04-08 10:19:12.632567"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (3.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 23ms (ActiveRecord: 13.8ms)  (3.3ms) SELECT COUNT(*) FROM "accounts" Account Load (2.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (3.1ms) ROLLBACK  (1.3ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (2.4ms) ROLLBACK  (0.5ms) BEGIN  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.091955"], ["updated_at", "2019-04-08 10:19:28.091955"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.116875"], ["updated_at", "2019-04-08 10:19:28.116875"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.151971"], ["updated_at", "2019-04-08 10:19:28.151971"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.183364"], ["updated_at", "2019-04-08 10:19:28.183364"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.211601"], ["updated_at", "2019-04-08 10:19:28.211601"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.238378"], ["updated_at", "2019-04-08 10:19:28.238378"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:28.292966"], ["updated_at", "2019-04-08 10:19:28.292966"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 26ms (ActiveRecord: 11.5ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:28.310986"], ["updated_at", "2019-04-08 10:19:28.310986"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.5ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:28.328968"], ["updated_at", "2019-04-08 10:19:28.328968"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:28.360535"], ["updated_at", "2019-04-08 10:19:28.360535"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 7.2ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.393626"], ["updated_at", "2019-04-08 10:19:28.393626"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.398301"], ["updated_at", "2019-04-08 10:19:28.398301"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.407447"], ["updated_at", "2019-04-08 10:19:28.407447"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.411796"], ["updated_at", "2019-04-08 10:19:28.411796"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1522], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:28.417194"], ["id", 1522]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.424708"], ["updated_at", "2019-04-08 10:19:28.424708"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.430033"], ["updated_at", "2019-04-08 10:19:28.430033"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1524], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:28.437073"], ["id", 1524]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1524], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.450039"], ["updated_at", "2019-04-08 10:19:28.450039"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.455776"], ["updated_at", "2019-04-08 10:19:28.455776"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1526], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:28.462437"], ["id", 1526]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1526], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.471336"], ["updated_at", "2019-04-08 10:19:28.471336"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.475754"], ["updated_at", "2019-04-08 10:19:28.475754"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:28.482696"], ["updated_at", "2019-04-08 10:19:28.482696"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:28.492890"], ["updated_at", "2019-04-08 10:19:28.492890"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.497829"], ["updated_at", "2019-04-08 10:19:28.497829"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:28.508383"], ["updated_at", "2019-04-08 10:19:28.508383"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.514258"], ["updated_at", "2019-04-08 10:19:28.514258"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:19:28.524861"], ["updated_at", "2019-04-08 10:19:28.524861"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.530789"], ["updated_at", "2019-04-08 10:19:28.530789"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.539212"], ["updated_at", "2019-04-08 10:19:28.539212"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.545821"], ["updated_at", "2019-04-08 10:19:28.545821"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.551279"], ["updated_at", "2019-04-08 10:19:28.551279"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:19:28.561301"], ["updated_at", "2019-04-08 10:19:28.561301"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805168"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:19:28.572289"], ["updated_at", "2019-04-08 10:19:28.572289"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632368"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1539], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:19:28.579269"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891568"], ["id", 1539]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1539]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.592209"], ["updated_at", "2019-04-08 10:19:28.592209"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.598712"], ["updated_at", "2019-04-08 10:19:28.598712"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:28.608020"], ["updated_at", "2019-04-08 10:19:28.608020"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:28.622307"], ["updated_at", "2019-04-08 10:19:28.622307"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1542], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1542], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:19:28.629179"], ["id", 1542]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1542], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.638735"], ["updated_at", "2019-04-08 10:19:28.638735"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.654017"], ["updated_at", "2019-04-08 10:19:28.654017"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.658036"], ["updated_at", "2019-04-08 10:19:28.658036"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.662303"], ["updated_at", "2019-04-08 10:19:28.662303"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.666342"], ["updated_at", "2019-04-08 10:19:28.666342"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.675306"], ["updated_at", "2019-04-08 10:19:28.675306"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.681071"], ["updated_at", "2019-04-08 10:19:28.681071"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.740140"], ["updated_at", "2019-04-08 10:19:28.740140"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:28.754169"], ["updated_at", "2019-04-08 10:19:28.754169"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.765568"], ["updated_at", "2019-04-08 10:19:28.765568"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.771214"], ["updated_at", "2019-04-08 10:19:28.771214"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.789244"], ["updated_at", "2019-04-08 10:19:28.789244"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.797279"], ["updated_at", "2019-04-08 10:19:28.797279"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1386], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:28.807431"], ["id", 1386]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.816116"], ["updated_at", "2019-04-08 10:19:28.816116"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.820413"], ["updated_at", "2019-04-08 10:19:28.820413"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1388], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:28.825805"], ["id", 1388]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.833033"], ["updated_at", "2019-04-08 10:19:28.833033"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.837329"], ["updated_at", "2019-04-08 10:19:28.837329"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1390], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:28.842852"], ["id", 1390]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1390], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.851932"], ["updated_at", "2019-04-08 10:19:28.851932"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.856874"], ["updated_at", "2019-04-08 10:19:28.856874"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1392], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:19:28.862019"], ["id", 1392]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1392], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.869454"], ["updated_at", "2019-04-08 10:19:28.869454"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:28.876409"], ["updated_at", "2019-04-08 10:19:28.876409"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.885760"], ["updated_at", "2019-04-08 10:19:28.885760"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:28.892467"], ["updated_at", "2019-04-08 10:19:28.892467"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.900494"], ["updated_at", "2019-04-08 10:19:28.900494"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:28.906987"], ["updated_at", "2019-04-08 10:19:28.906987"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:19:28.913930"], ["updated_at", "2019-04-08 10:19:28.913930"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:19:28.919890"], ["updated_at", "2019-04-08 10:19:28.919890"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:28.927788"], ["updated_at", "2019-04-08 10:19:28.927788"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:19:28.934604"], ["updated_at", "2019-04-08 10:19:28.934604"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1402], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1402], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:19:28.940265"], ["id", 1402]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1402], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:28.948276"], ["updated_at", "2019-04-08 10:19:28.948276"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:28.954950"], ["updated_at", "2019-04-08 10:19:28.954950"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:28.962012"], ["updated_at", "2019-04-08 10:19:28.962012"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:28.966510"], ["updated_at", "2019-04-08 10:19:28.966510"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:28.971295"], ["updated_at", "2019-04-08 10:19:28.971295"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:19:28.983435"], ["updated_at", "2019-04-08 10:19:28.983435"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:19:28.987686"], ["synced_id", 0], ["id", 1407]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:28.999177"], ["updated_at", "2019-04-08 10:19:28.999177"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805168"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:19:29.009795"], ["updated_at", "2019-04-08 10:19:29.009795"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632369"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1409], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:19:29.015567"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891569"], ["id", 1409]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1409]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:19:29.027702"], ["updated_at", "2019-04-08 10:19:29.027702"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.577787"], ["updated_at", "2019-04-08 10:22:31.577787"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.582792"], ["updated_at", "2019-04-08 10:22:31.582792"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:22:31.611665"], ["updated_at", "2019-04-08 10:22:31.611665"], ["synced_id", 123]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:22:31.635889"], ["updated_at", "2019-04-08 10:22:31.635889"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:22:31.650793"], ["updated_at", "2019-04-08 10:22:31.650793"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805351"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:22:31.662658"], ["updated_at", "2019-04-08 10:22:31.662658"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632551"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1413], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:22:31.672172"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891751"], ["id", 1413]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (0.8ms) SAVEPOINT active_record_1 Account Destroy (0.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1413]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:31.687408"], ["updated_at", "2019-04-08 10:22:31.687408"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1414], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1414], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:22:31.695757"], ["id", 1414]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1414], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:22:31.707194"], ["updated_at", "2019-04-08 10:22:31.707194"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:22:31.720751"], ["updated_at", "2019-04-08 10:22:31.720751"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:22:31.732792"], ["updated_at", "2019-04-08 10:22:31.732792"], ["synced_id", 1]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:22:31.739313"], ["updated_at", "2019-04-08 10:22:31.739313"], ["synced_id", 2]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:22:31.746184"], ["updated_at", "2019-04-08 10:22:31.746184"], ["synced_id", 3]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:22:31.761315"], ["updated_at", "2019-04-08 10:22:31.761315"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.798729"], ["updated_at", "2019-04-08 10:22:31.798729"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.803350"], ["updated_at", "2019-04-08 10:22:31.803350"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1422], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:22:31.809742"], ["id", 1422]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.818665"], ["updated_at", "2019-04-08 10:22:31.818665"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.822944"], ["updated_at", "2019-04-08 10:22:31.822944"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1424], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:22:31.830349"], ["id", 1424]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1424], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.841895"], ["updated_at", "2019-04-08 10:22:31.841895"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.847209"], ["updated_at", "2019-04-08 10:22:31.847209"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1426], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:22:31.856303"], ["id", 1426]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1426], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.867470"], ["updated_at", "2019-04-08 10:22:31.867470"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.873026"], ["updated_at", "2019-04-08 10:22:31.873026"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1428], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:22:31.878975"], ["id", 1428]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.888679"], ["updated_at", "2019-04-08 10:22:31.888679"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (8.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:22:31.896431"], ["updated_at", "2019-04-08 10:22:31.896431"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.914868"], ["updated_at", "2019-04-08 10:22:31.914868"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:22:31.921862"], ["updated_at", "2019-04-08 10:22:31.921862"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.929571"], ["updated_at", "2019-04-08 10:22:31.929571"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:22:31.940688"], ["updated_at", "2019-04-08 10:22:31.940688"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:31.949428"], ["updated_at", "2019-04-08 10:22:31.949428"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:22:31.957503"], ["updated_at", "2019-04-08 10:22:31.957503"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:22:31.971949"], ["updated_at", "2019-04-08 10:22:31.971949"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:22:31.975785"], ["synced_id", 0], ["id", 1437]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:22:31.999303"], ["updated_at", "2019-04-08 10:22:31.999303"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:22:32.011967"], ["updated_at", "2019-04-08 10:22:32.011967"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.9ms)  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:22:32.025862"], ["updated_at", "2019-04-08 10:22:32.025862"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.3ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:22:32.042921"], ["updated_at", "2019-04-08 10:22:32.042921"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.6ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.093804"], ["updated_at", "2019-04-08 10:22:32.093804"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.115708"], ["updated_at", "2019-04-08 10:22:32.115708"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (1.4ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.138583"], ["updated_at", "2019-04-08 10:22:32.138583"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.156004"], ["updated_at", "2019-04-08 10:22:32.156004"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.172790"], ["updated_at", "2019-04-08 10:22:32.172790"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.195288"], ["updated_at", "2019-04-08 10:22:32.195288"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.221402"], ["updated_at", "2019-04-08 10:22:32.221402"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:22:32.258376"], ["updated_at", "2019-04-08 10:22:32.258376"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:32.267170"], ["updated_at", "2019-04-08 10:22:32.267170"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.275602"], ["updated_at", "2019-04-08 10:22:32.275602"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.282448"], ["updated_at", "2019-04-08 10:22:32.282448"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:32.291251"], ["updated_at", "2019-04-08 10:22:32.291251"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.297768"], ["updated_at", "2019-04-08 10:22:32.297768"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:22:32.306385"], ["updated_at", "2019-04-08 10:22:32.306385"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805352"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:22:32.313813"], ["updated_at", "2019-04-08 10:22:32.313813"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632552"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1560], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:22:32.320372"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891752"], ["id", 1560]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1560]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:32.332985"], ["updated_at", "2019-04-08 10:22:32.332985"], ["synced_id", 1], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:32.341340"], ["updated_at", "2019-04-08 10:22:32.341340"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:32.349265"], ["updated_at", "2019-04-08 10:22:32.349265"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:32.357313"], ["updated_at", "2019-04-08 10:22:32.357313"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.367471"], ["updated_at", "2019-04-08 10:22:32.367471"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.371796"], ["updated_at", "2019-04-08 10:22:32.371796"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1565], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:22:32.376859"], ["id", 1565]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.384632"], ["updated_at", "2019-04-08 10:22:32.384632"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.390400"], ["updated_at", "2019-04-08 10:22:32.390400"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1567], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:22:32.396737"], ["id", 1567]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1567], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.406986"], ["updated_at", "2019-04-08 10:22:32.406986"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.411682"], ["updated_at", "2019-04-08 10:22:32.411682"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1569], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:22:32.417046"], ["id", 1569]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1569], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.425663"], ["updated_at", "2019-04-08 10:22:32.425663"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.429579"], ["updated_at", "2019-04-08 10:22:32.429579"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:22:32.437901"], ["updated_at", "2019-04-08 10:22:32.437901"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:22:32.448083"], ["updated_at", "2019-04-08 10:22:32.448083"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.453957"], ["updated_at", "2019-04-08 10:22:32.453957"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:22:32.462198"], ["updated_at", "2019-04-08 10:22:32.462198"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.466484"], ["updated_at", "2019-04-08 10:22:32.466484"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:22:32.478867"], ["updated_at", "2019-04-08 10:22:32.478867"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.483885"], ["updated_at", "2019-04-08 10:22:32.483885"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.493041"], ["updated_at", "2019-04-08 10:22:32.493041"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.498166"], ["updated_at", "2019-04-08 10:22:32.498166"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:22:32.514264"], ["updated_at", "2019-04-08 10:22:32.514264"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1582], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1582], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:22:32.523537"], ["id", 1582]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1582], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:22:32.533704"], ["updated_at", "2019-04-08 10:22:32.533704"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.541901"], ["updated_at", "2019-04-08 10:22:32.541901"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:22:32.564957"], ["updated_at", "2019-04-08 10:22:32.564957"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:03.667233"], ["updated_at", "2019-04-08 10:23:03.667233"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 54ms (ActiveRecord: 18.4ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:03.682550"], ["updated_at", "2019-04-08 10:23:03.682550"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 4.7ms)  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:03.710782"], ["updated_at", "2019-04-08 10:23:03.710782"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 5.7ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:03.762327"], ["updated_at", "2019-04-08 10:23:03.762327"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 33ms (ActiveRecord: 9.9ms)  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:03.780256"], ["updated_at", "2019-04-08 10:23:03.780256"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (1.3ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:03.820182"], ["updated_at", "2019-04-08 10:23:03.820182"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632583"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1445], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:23:03.828003"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891783"], ["id", 1445]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1445]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:03.838574"], ["updated_at", "2019-04-08 10:23:03.838574"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805383"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:23:03.850610"], ["updated_at", "2019-04-08 10:23:03.850610"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:23:03.853359"], ["synced_id", 0], ["id", 1447]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:03.865421"], ["updated_at", "2019-04-08 10:23:03.865421"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:03.869756"], ["updated_at", "2019-04-08 10:23:03.869756"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:03.873130"], ["updated_at", "2019-04-08 10:23:03.873130"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.8ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:03.881481"], ["updated_at", "2019-04-08 10:23:03.881481"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1451], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1451], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:23:03.889399"], ["id", 1451]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1451], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:03.902326"], ["updated_at", "2019-04-08 10:23:03.902326"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:03.909179"], ["updated_at", "2019-04-08 10:23:03.909179"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.917114"], ["updated_at", "2019-04-08 10:23:03.917114"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.920721"], ["updated_at", "2019-04-08 10:23:03.920721"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1454], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:03.925421"], ["id", 1454]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1454], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.934108"], ["updated_at", "2019-04-08 10:23:03.934108"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.937790"], ["updated_at", "2019-04-08 10:23:03.937790"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1456], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:03.942640"], ["id", 1456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1456], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.952103"], ["updated_at", "2019-04-08 10:23:03.952103"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.955972"], ["updated_at", "2019-04-08 10:23:03.955972"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1458], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:03.961436"], ["id", 1458]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.968200"], ["updated_at", "2019-04-08 10:23:03.968200"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.971728"], ["updated_at", "2019-04-08 10:23:03.971728"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1460], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:03.977098"], ["id", 1460]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.983936"], ["updated_at", "2019-04-08 10:23:03.983936"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:03.989520"], ["updated_at", "2019-04-08 10:23:03.989520"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.5ms) ROLLBACK  (1.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:03.998815"], ["updated_at", "2019-04-08 10:23:03.998815"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:04.004333"], ["updated_at", "2019-04-08 10:23:04.004333"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.012077"], ["updated_at", "2019-04-08 10:23:04.012077"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:04.018098"], ["updated_at", "2019-04-08 10:23:04.018098"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.024947"], ["updated_at", "2019-04-08 10:23:04.024947"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:04.029987"], ["updated_at", "2019-04-08 10:23:04.029987"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:04.038029"], ["updated_at", "2019-04-08 10:23:04.038029"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.8ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.102313"], ["updated_at", "2019-04-08 10:23:04.102313"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.119567"], ["updated_at", "2019-04-08 10:23:04.119567"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.136726"], ["updated_at", "2019-04-08 10:23:04.136726"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.160101"], ["updated_at", "2019-04-08 10:23:04.160101"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.173567"], ["updated_at", "2019-04-08 10:23:04.173567"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.196213"], ["updated_at", "2019-04-08 10:23:04.196213"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:23:04.219991"], ["updated_at", "2019-04-08 10:23:04.219991"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805384"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:23:04.227588"], ["updated_at", "2019-04-08 10:23:04.227588"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632584"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1588], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:23:04.232658"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891784"], ["id", 1588]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1588]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.243369"], ["updated_at", "2019-04-08 10:23:04.243369"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.250355"], ["updated_at", "2019-04-08 10:23:04.250355"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.256971"], ["updated_at", "2019-04-08 10:23:04.256971"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.269848"], ["updated_at", "2019-04-08 10:23:04.269848"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.275454"], ["updated_at", "2019-04-08 10:23:04.275454"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:04.282548"], ["updated_at", "2019-04-08 10:23:04.282548"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:04.293254"], ["updated_at", "2019-04-08 10:23:04.293254"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.297600"], ["updated_at", "2019-04-08 10:23:04.297600"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:04.308017"], ["updated_at", "2019-04-08 10:23:04.308017"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.318720"], ["updated_at", "2019-04-08 10:23:04.318720"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.2ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:04.330447"], ["updated_at", "2019-04-08 10:23:04.330447"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.336483"], ["updated_at", "2019-04-08 10:23:04.336483"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.345090"], ["updated_at", "2019-04-08 10:23:04.345090"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.350229"], ["updated_at", "2019-04-08 10:23:04.350229"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1599], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:04.356628"], ["id", 1599]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.364409"], ["updated_at", "2019-04-08 10:23:04.364409"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.369297"], ["updated_at", "2019-04-08 10:23:04.369297"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1601], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:04.375174"], ["id", 1601]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1601], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.384534"], ["updated_at", "2019-04-08 10:23:04.384534"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.388801"], ["updated_at", "2019-04-08 10:23:04.388801"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1603], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:04.393919"], ["id", 1603]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1603], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.402101"], ["updated_at", "2019-04-08 10:23:04.402101"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.405885"], ["updated_at", "2019-04-08 10:23:04.405885"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.416776"], ["updated_at", "2019-04-08 10:23:04.416776"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.426294"], ["updated_at", "2019-04-08 10:23:04.426294"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:04.443672"], ["updated_at", "2019-04-08 10:23:04.443672"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1608], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1608], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:23:04.450456"], ["id", 1608]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1608], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.459177"], ["updated_at", "2019-04-08 10:23:04.459177"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.466153"], ["updated_at", "2019-04-08 10:23:04.466153"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:04.488583"], ["updated_at", "2019-04-08 10:23:04.488583"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.496240"], ["updated_at", "2019-04-08 10:23:04.496240"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.500348"], ["updated_at", "2019-04-08 10:23:04.500348"], ["synced_id", 2], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.503939"], ["updated_at", "2019-04-08 10:23:04.503939"], ["synced_id", 1], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.508310"], ["updated_at", "2019-04-08 10:23:04.508310"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.517777"], ["updated_at", "2019-04-08 10:23:04.517777"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.523492"], ["updated_at", "2019-04-08 10:23:04.523492"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:04.533447"], ["updated_at", "2019-04-08 10:23:04.533447"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.559696"], ["updated_at", "2019-04-08 10:23:04.559696"], ["synced_id", 123], ["host", "example.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:04.563633"], ["updated_at", "2019-04-08 10:23:04.563633"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:04.573525"], ["updated_at", "2019-04-08 10:23:04.573525"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (7.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:44.676228"], ["updated_at", "2019-04-08 10:23:44.676228"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:44.704347"], ["updated_at", "2019-04-08 10:23:44.704347"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:44.723801"], ["updated_at", "2019-04-08 10:23:44.723801"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:44.751355"], ["updated_at", "2019-04-08 10:23:44.751355"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:44.763401"], ["updated_at", "2019-04-08 10:23:44.763401"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:44.767316"], ["updated_at", "2019-04-08 10:23:44.767316"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:44.770931"], ["updated_at", "2019-04-08 10:23:44.770931"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:23:44.790135"], ["updated_at", "2019-04-08 10:23:44.790135"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:23:44.794349"], ["synced_id", 0], ["id", 1477]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.814850"], ["updated_at", "2019-04-08 10:23:44.814850"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.821505"], ["updated_at", "2019-04-08 10:23:44.821505"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1479], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:44.828867"], ["id", 1479]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1479], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.842352"], ["updated_at", "2019-04-08 10:23:44.842352"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.849176"], ["updated_at", "2019-04-08 10:23:44.849176"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1481], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:44.860391"], ["id", 1481]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1481], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.871124"], ["updated_at", "2019-04-08 10:23:44.871124"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.876207"], ["updated_at", "2019-04-08 10:23:44.876207"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1483], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:44.881538"], ["id", 1483]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.888714"], ["updated_at", "2019-04-08 10:23:44.888714"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.893443"], ["updated_at", "2019-04-08 10:23:44.893443"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1485], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:44.901890"], ["id", 1485]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.909994"], ["updated_at", "2019-04-08 10:23:44.909994"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:44.916520"], ["updated_at", "2019-04-08 10:23:44.916520"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.926006"], ["updated_at", "2019-04-08 10:23:44.926006"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:44.931240"], ["updated_at", "2019-04-08 10:23:44.931240"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.938348"], ["updated_at", "2019-04-08 10:23:44.938348"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:44.944196"], ["updated_at", "2019-04-08 10:23:44.944196"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:44.950909"], ["updated_at", "2019-04-08 10:23:44.950909"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:44.956132"], ["updated_at", "2019-04-08 10:23:44.956132"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:44.964056"], ["updated_at", "2019-04-08 10:23:44.964056"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632624"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1494], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:23:44.969108"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891824"], ["id", 1494]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1494]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:44.980164"], ["updated_at", "2019-04-08 10:23:44.980164"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805424"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:44.987706"], ["updated_at", "2019-04-08 10:23:44.987706"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1496], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1496], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:23:44.995275"], ["id", 1496]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1496], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.024678"], ["updated_at", "2019-04-08 10:23:45.024678"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.040689"], ["updated_at", "2019-04-08 10:23:45.040689"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.071155"], ["updated_at", "2019-04-08 10:23:45.071155"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.100499"], ["updated_at", "2019-04-08 10:23:45.100499"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.119755"], ["updated_at", "2019-04-08 10:23:45.119755"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.136960"], ["updated_at", "2019-04-08 10:23:45.136960"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.168899"], ["updated_at", "2019-04-08 10:23:45.168899"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:23:45.190894"], ["updated_at", "2019-04-08 10:23:45.190894"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.200543"], ["updated_at", "2019-04-08 10:23:45.200543"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.205456"], ["updated_at", "2019-04-08 10:23:45.205456"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:45.267412"], ["updated_at", "2019-04-08 10:23:45.267412"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.277769"], ["updated_at", "2019-04-08 10:23:45.277769"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.290609"], ["updated_at", "2019-04-08 10:23:45.290609"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.303383"], ["updated_at", "2019-04-08 10:23:45.303383"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.308905"], ["updated_at", "2019-04-08 10:23:45.308905"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1623], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:45.316866"], ["id", 1623]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.324915"], ["updated_at", "2019-04-08 10:23:45.324915"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.329742"], ["updated_at", "2019-04-08 10:23:45.329742"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1625], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:45.335109"], ["id", 1625]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1625], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.344286"], ["updated_at", "2019-04-08 10:23:45.344286"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.348675"], ["updated_at", "2019-04-08 10:23:45.348675"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1627], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:23:45.355892"], ["id", 1627]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1627], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.365638"], ["updated_at", "2019-04-08 10:23:45.365638"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.369983"], ["updated_at", "2019-04-08 10:23:45.369983"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:45.377070"], ["updated_at", "2019-04-08 10:23:45.377070"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:45.386804"], ["updated_at", "2019-04-08 10:23:45.386804"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.391464"], ["updated_at", "2019-04-08 10:23:45.391464"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:45.400063"], ["updated_at", "2019-04-08 10:23:45.400063"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.404702"], ["updated_at", "2019-04-08 10:23:45.404702"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:45.413568"], ["updated_at", "2019-04-08 10:23:45.413568"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.418045"], ["updated_at", "2019-04-08 10:23:45.418045"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.427384"], ["updated_at", "2019-04-08 10:23:45.427384"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.431436"], ["updated_at", "2019-04-08 10:23:45.431436"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:23:45.439524"], ["updated_at", "2019-04-08 10:23:45.439524"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805425"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:23:45.447525"], ["updated_at", "2019-04-08 10:23:45.447525"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632625"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1641], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:23:45.452579"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891825"], ["id", 1641]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1641]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.463777"], ["updated_at", "2019-04-08 10:23:45.463777"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.469911"], ["updated_at", "2019-04-08 10:23:45.469911"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:23:45.492110"], ["updated_at", "2019-04-08 10:23:45.492110"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1643], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1643], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:23:45.498327"], ["id", 1643]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1643], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.506647"], ["updated_at", "2019-04-08 10:23:45.506647"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.513317"], ["updated_at", "2019-04-08 10:23:45.513317"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.519342"], ["updated_at", "2019-04-08 10:23:45.519342"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.528133"], ["updated_at", "2019-04-08 10:23:45.528133"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:23:45.547474"], ["updated_at", "2019-04-08 10:23:45.547474"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.556073"], ["updated_at", "2019-04-08 10:23:45.556073"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.560760"], ["updated_at", "2019-04-08 10:23:45.560760"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.565031"], ["updated_at", "2019-04-08 10:23:45.565031"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:23:45.568975"], ["updated_at", "2019-04-08 10:23:45.568975"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:45.581968"], ["updated_at", "2019-04-08 10:23:45.581968"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.4ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:45.596293"], ["updated_at", "2019-04-08 10:23:45.596293"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:23:45.609952"], ["updated_at", "2019-04-08 10:23:45.609952"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.1ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:23:45.627223"], ["updated_at", "2019-04-08 10:23:45.627223"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (3.3ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (3.2ms) ROLLBACK  (2.4ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (3.1ms) ROLLBACK  (5.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (5.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.3ms) SAVEPOINT active_record_1 Account Exists (3.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:20.826563"], ["updated_at", "2019-04-08 10:24:20.826563"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (4.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 130ms (ActiveRecord: 52.3ms)  (1.9ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.7ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:20.869073"], ["updated_at", "2019-04-08 10:24:20.869073"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 22ms (ActiveRecord: 13.6ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:20.892566"], ["updated_at", "2019-04-08 10:24:20.892566"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.5ms)  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (3.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.8ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:20.945480"], ["updated_at", "2019-04-08 10:24:20.945480"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 29ms (ActiveRecord: 11.8ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.003364"], ["updated_at", "2019-04-08 10:24:21.003364"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.024328"], ["updated_at", "2019-04-08 10:24:21.024328"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.048088"], ["updated_at", "2019-04-08 10:24:21.048088"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.065823"], ["updated_at", "2019-04-08 10:24:21.065823"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.6ms) BEGIN  (2.5ms) SAVEPOINT active_record_1 Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.096870"], ["updated_at", "2019-04-08 10:24:21.096870"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.130649"], ["updated_at", "2019-04-08 10:24:21.130649"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:21.143784"], ["updated_at", "2019-04-08 10:24:21.143784"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.4ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.168730"], ["updated_at", "2019-04-08 10:24:21.168730"], ["synced_id", 123], ["host", "example.host"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.184168"], ["updated_at", "2019-04-08 10:24:21.184168"], ["synced_id", 123], ["host", "test.host"]]  (3.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.217513"], ["updated_at", "2019-04-08 10:24:21.217513"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (4.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.8ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (5.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:24:21.265439"], ["updated_at", "2019-04-08 10:24:21.265439"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805461"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (2.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:24:21.291961"], ["updated_at", "2019-04-08 10:24:21.291961"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632661"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1655], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:24:21.305871"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891861"], ["id", 1655]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1655]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.323904"], ["updated_at", "2019-04-08 10:24:21.323904"], ["synced_id", 1], ["host", "example.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.336844"], ["updated_at", "2019-04-08 10:24:21.336844"], ["synced_id", 2], ["host", "example.test"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.354872"], ["updated_at", "2019-04-08 10:24:21.354872"], ["synced_id", 1], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.366415"], ["updated_at", "2019-04-08 10:24:21.366415"], ["synced_id", 2], ["host", "example2.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.381117"], ["updated_at", "2019-04-08 10:24:21.381117"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.388912"], ["updated_at", "2019-04-08 10:24:21.388912"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:21.406673"], ["updated_at", "2019-04-08 10:24:21.406673"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.0ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:21.424574"], ["updated_at", "2019-04-08 10:24:21.424574"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.431905"], ["updated_at", "2019-04-08 10:24:21.431905"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.0ms) BEGIN MultiApplicationsAccount Load (1.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:21.452751"], ["updated_at", "2019-04-08 10:24:21.452751"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.462995"], ["updated_at", "2019-04-08 10:24:21.462995"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Load (4.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:21.488373"], ["updated_at", "2019-04-08 10:24:21.488373"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.498039"], ["updated_at", "2019-04-08 10:24:21.498039"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (4.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.513344"], ["updated_at", "2019-04-08 10:24:21.513344"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.525642"], ["updated_at", "2019-04-08 10:24:21.525642"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (3.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1669], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:21.541943"], ["id", 1669]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.5ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.560696"], ["updated_at", "2019-04-08 10:24:21.560696"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.587616"], ["updated_at", "2019-04-08 10:24:21.587616"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1671], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:21.602111"], ["id", 1671]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1671], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.614710"], ["updated_at", "2019-04-08 10:24:21.614710"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.619490"], ["updated_at", "2019-04-08 10:24:21.619490"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1673], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:21.626068"], ["id", 1673]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1673], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.635182"], ["updated_at", "2019-04-08 10:24:21.635182"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.641894"], ["updated_at", "2019-04-08 10:24:21.641894"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.652799"], ["updated_at", "2019-04-08 10:24:21.652799"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:21.678601"], ["updated_at", "2019-04-08 10:24:21.678601"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:21.691183"], ["updated_at", "2019-04-08 10:24:21.691183"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1679], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1679], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:24:21.697444"], ["id", 1679]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1679], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.708515"], ["updated_at", "2019-04-08 10:24:21.708515"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.717152"], ["updated_at", "2019-04-08 10:24:21.717152"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.748508"], ["updated_at", "2019-04-08 10:24:21.748508"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.758845"], ["updated_at", "2019-04-08 10:24:21.758845"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.764759"], ["updated_at", "2019-04-08 10:24:21.764759"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.770745"], ["updated_at", "2019-04-08 10:24:21.770745"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.781320"], ["updated_at", "2019-04-08 10:24:21.781320"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:21.792879"], ["updated_at", "2019-04-08 10:24:21.792879"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (2.6ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (1.4ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.831363"], ["updated_at", "2019-04-08 10:24:21.831363"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.837143"], ["updated_at", "2019-04-08 10:24:21.837143"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1506], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:21.846392"], ["id", 1506]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1506], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.859257"], ["updated_at", "2019-04-08 10:24:21.859257"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.865310"], ["updated_at", "2019-04-08 10:24:21.865310"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1508], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:21.872313"], ["id", 1508]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1508], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.882572"], ["updated_at", "2019-04-08 10:24:21.882572"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.886936"], ["updated_at", "2019-04-08 10:24:21.886936"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1510], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:21.892473"], ["id", 1510]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.899187"], ["updated_at", "2019-04-08 10:24:21.899187"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.903179"], ["updated_at", "2019-04-08 10:24:21.903179"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1512], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:21.910044"], ["id", 1512]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.917942"], ["updated_at", "2019-04-08 10:24:21.917942"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:21.927005"], ["updated_at", "2019-04-08 10:24:21.927005"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.938720"], ["updated_at", "2019-04-08 10:24:21.938720"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:21.946388"], ["updated_at", "2019-04-08 10:24:21.946388"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.954592"], ["updated_at", "2019-04-08 10:24:21.954592"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:21.963147"], ["updated_at", "2019-04-08 10:24:21.963147"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:21.971969"], ["updated_at", "2019-04-08 10:24:21.971969"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:21.980054"], ["updated_at", "2019-04-08 10:24:21.980054"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:24:21.995502"], ["updated_at", "2019-04-08 10:24:21.995502"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:24:21.999775"], ["synced_id", 0], ["id", 1521]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:22.013081"], ["updated_at", "2019-04-08 10:24:22.013081"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:22.038825"], ["updated_at", "2019-04-08 10:24:22.038825"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1523], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1523], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:24:22.047628"], ["id", 1523]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1523], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:22.057186"], ["updated_at", "2019-04-08 10:24:22.057186"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:22.061690"], ["updated_at", "2019-04-08 10:24:22.061690"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:22.066130"], ["updated_at", "2019-04-08 10:24:22.066130"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:22.076444"], ["updated_at", "2019-04-08 10:24:22.076444"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:22.084004"], ["updated_at", "2019-04-08 10:24:22.084004"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:22.093303"], ["updated_at", "2019-04-08 10:24:22.093303"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632662"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1529], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:24:22.099522"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891862"], ["id", 1529]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1529]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:22.112071"], ["updated_at", "2019-04-08 10:24:22.112071"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805462"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:22.119951"], ["updated_at", "2019-04-08 10:24:22.119951"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (1.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:49.955263"], ["updated_at", "2019-04-08 10:24:49.955263"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN Account Load (1.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:24:49.989659"], ["updated_at", "2019-04-08 10:24:49.989659"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:24:49.995956"], ["synced_id", 0], ["id", 1531]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:50.012618"], ["updated_at", "2019-04-08 10:24:50.012618"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:50.024745"], ["updated_at", "2019-04-08 10:24:50.024745"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805490"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:50.047291"], ["updated_at", "2019-04-08 10:24:50.047291"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632690"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1534], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:24:50.059302"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891890"], ["id", 1534]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.8ms) SAVEPOINT active_record_1 Account Destroy (1.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1534]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:50.075829"], ["updated_at", "2019-04-08 10:24:50.075829"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:50.109500"], ["updated_at", "2019-04-08 10:24:50.109500"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.6ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.122498"], ["updated_at", "2019-04-08 10:24:50.122498"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:50.135321"], ["updated_at", "2019-04-08 10:24:50.135321"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.144788"], ["updated_at", "2019-04-08 10:24:50.144788"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:50.152584"], ["updated_at", "2019-04-08 10:24:50.152584"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.160241"], ["updated_at", "2019-04-08 10:24:50.160241"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:50.166527"], ["updated_at", "2019-04-08 10:24:50.166527"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.174568"], ["updated_at", "2019-04-08 10:24:50.174568"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:50.180807"], ["updated_at", "2019-04-08 10:24:50.180807"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.190670"], ["updated_at", "2019-04-08 10:24:50.190670"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.194996"], ["updated_at", "2019-04-08 10:24:50.194996"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1546], ["LIMIT", 1]] Account Update (2.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:50.203056"], ["id", 1546]]  (2.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1546], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.220770"], ["updated_at", "2019-04-08 10:24:50.220770"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.228296"], ["updated_at", "2019-04-08 10:24:50.228296"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1548], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:50.235054"], ["id", 1548]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1548], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.244601"], ["updated_at", "2019-04-08 10:24:50.244601"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.250984"], ["updated_at", "2019-04-08 10:24:50.250984"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1550], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:50.258479"], ["id", 1550]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.265649"], ["updated_at", "2019-04-08 10:24:50.265649"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.270008"], ["updated_at", "2019-04-08 10:24:50.270008"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1552], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:50.276507"], ["id", 1552]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:50.283377"], ["updated_at", "2019-04-08 10:24:50.283377"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:50.287922"], ["updated_at", "2019-04-08 10:24:50.287922"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:50.292248"], ["updated_at", "2019-04-08 10:24:50.292248"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.306605"], ["updated_at", "2019-04-08 10:24:50.306605"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1556], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1556], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:24:50.312036"], ["id", 1556]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1556], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:24:50.325586"], ["updated_at", "2019-04-08 10:24:50.325586"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.336394"], ["updated_at", "2019-04-08 10:24:50.336394"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.342011"], ["updated_at", "2019-04-08 10:24:50.342011"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (2.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.373041"], ["updated_at", "2019-04-08 10:24:50.373041"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) ROLLBACK  (2.9ms) BEGIN  (2.4ms) ROLLBACK  (1.2ms) BEGIN  (1.7ms) ROLLBACK  (1.8ms) BEGIN  (1.5ms) ROLLBACK  (2.7ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:50.429552"], ["updated_at", "2019-04-08 10:24:50.429552"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (4.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1687], ["LIMIT", 1]]  (3.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1687], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.4ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:24:50.460750"], ["id", 1687]]  (3.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1687], ["LIMIT", 1]]  (3.3ms) ROLLBACK  (2.9ms) BEGIN  (3.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.499717"], ["updated_at", "2019-04-08 10:24:50.499717"], ["synced_id", 123], ["host", "test.example"]]  (2.6ms) RELEASE SAVEPOINT active_record_1  (2.7ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (4.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (2.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.528531"], ["updated_at", "2019-04-08 10:24:50.528531"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.8ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 Application Exists (3.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (4.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.554538"], ["updated_at", "2019-04-08 10:24:50.554538"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (2.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.2ms) ROLLBACK  (3.4ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:24:50.583850"], ["updated_at", "2019-04-08 10:24:50.583850"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.596798"], ["updated_at", "2019-04-08 10:24:50.596798"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (4.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.605566"], ["updated_at", "2019-04-08 10:24:50.605566"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (4.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.639425"], ["updated_at", "2019-04-08 10:24:50.639425"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (2.6ms) RELEASE SAVEPOINT active_record_1 Application Load (2.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (3.6ms) ROLLBACK  (2.8ms) BEGIN  (3.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.679453"], ["updated_at", "2019-04-08 10:24:50.679453"], ["synced_id", 1], ["host", "example.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (3.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.700081"], ["updated_at", "2019-04-08 10:24:50.700081"], ["synced_id", 2], ["host", "example.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (5.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.716588"], ["updated_at", "2019-04-08 10:24:50.716588"], ["synced_id", 1], ["host", "example2.test"]]  (3.0ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (5.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:50.739138"], ["updated_at", "2019-04-08 10:24:50.739138"], ["synced_id", 2], ["host", "example2.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (2.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.765647"], ["updated_at", "2019-04-08 10:24:50.765647"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.779155"], ["updated_at", "2019-04-08 10:24:50.779155"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1695], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (4.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:50.801323"], ["id", 1695]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (2.7ms) ROLLBACK  (4.1ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.827873"], ["updated_at", "2019-04-08 10:24:50.827873"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (3.4ms) RELEASE SAVEPOINT active_record_1  (2.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.847824"], ["updated_at", "2019-04-08 10:24:50.847824"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (3.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1697], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:50.873195"], ["id", 1697]]  (1.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1697], ["LIMIT", 1]]  (2.3ms) ROLLBACK  (1.3ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.901083"], ["updated_at", "2019-04-08 10:24:50.901083"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (5.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.918185"], ["updated_at", "2019-04-08 10:24:50.918185"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (4.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1699], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (4.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:24:50.948942"], ["id", 1699]]  (3.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1699], ["LIMIT", 1]]  (3.7ms) ROLLBACK  (2.0ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (6.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:50.990640"], ["updated_at", "2019-04-08 10:24:50.990640"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.003064"], ["updated_at", "2019-04-08 10:24:51.003064"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (3.6ms) RELEASE SAVEPOINT active_record_1  (3.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (4.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:51.034997"], ["updated_at", "2019-04-08 10:24:51.034997"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (3.3ms) RELEASE SAVEPOINT active_record_1  (4.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (3.8ms) ROLLBACK  (1.3ms) BEGIN MultiApplicationsAccount Load (3.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:51.072983"], ["updated_at", "2019-04-08 10:24:51.072983"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.089564"], ["updated_at", "2019-04-08 10:24:51.089564"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (2.8ms) BEGIN MultiApplicationsAccount Load (3.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (4.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:51.124089"], ["updated_at", "2019-04-08 10:24:51.124089"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (3.2ms) RELEASE SAVEPOINT active_record_1  (3.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.144117"], ["updated_at", "2019-04-08 10:24:51.144117"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (3.7ms) ROLLBACK  (1.2ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:51.166179"], ["updated_at", "2019-04-08 10:24:51.166179"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.180344"], ["updated_at", "2019-04-08 10:24:51.180344"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.5ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (5.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.199864"], ["updated_at", "2019-04-08 10:24:51.199864"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.215203"], ["updated_at", "2019-04-08 10:24:51.215203"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (2.9ms) ROLLBACK  (3.1ms) BEGIN  (2.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:24:51.243482"], ["updated_at", "2019-04-08 10:24:51.243482"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554632691"], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1712], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:24:51.254460"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554891891"], ["id", 1712]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.1ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1712]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:24:51.272629"], ["updated_at", "2019-04-08 10:24:51.272629"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805491"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:24:51.281852"], ["updated_at", "2019-04-08 10:24:51.281852"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.293991"], ["updated_at", "2019-04-08 10:24:51.293991"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.318837"], ["updated_at", "2019-04-08 10:24:51.318837"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.359071"], ["updated_at", "2019-04-08 10:24:51.359071"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.379284"], ["updated_at", "2019-04-08 10:24:51.379284"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.404720"], ["updated_at", "2019-04-08 10:24:51.404720"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.426306"], ["updated_at", "2019-04-08 10:24:51.426306"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.446246"], ["updated_at", "2019-04-08 10:24:51.446246"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:24:51.472967"], ["updated_at", "2019-04-08 10:24:51.472967"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:51.508674"], ["updated_at", "2019-04-08 10:24:51.508674"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:51.519741"], ["updated_at", "2019-04-08 10:24:51.519741"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 5.5ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:24:51.537647"], ["updated_at", "2019-04-08 10:24:51.537647"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.1ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:24:51.561529"], ["updated_at", "2019-04-08 10:24:51.561529"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.7ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.142596"], ["updated_at", "2019-04-08 10:31:41.142596"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (1.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:31:41.186576"], ["updated_at", "2019-04-08 10:31:41.186576"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633101"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1717], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:31:41.202651"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892301"], ["id", 1717]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1717]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:31:41.216976"], ["updated_at", "2019-04-08 10:31:41.216976"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805901"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.226859"], ["updated_at", "2019-04-08 10:31:41.226859"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.233048"], ["updated_at", "2019-04-08 10:31:41.233048"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.262088"], ["updated_at", "2019-04-08 10:31:41.262088"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.266738"], ["updated_at", "2019-04-08 10:31:41.266738"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.271750"], ["updated_at", "2019-04-08 10:31:41.271750"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.276162"], ["updated_at", "2019-04-08 10:31:41.276162"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.286871"], ["updated_at", "2019-04-08 10:31:41.286871"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.291297"], ["updated_at", "2019-04-08 10:31:41.291297"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:31:41.301858"], ["updated_at", "2019-04-08 10:31:41.301858"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:31:41.311794"], ["updated_at", "2019-04-08 10:31:41.311794"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.315626"], ["updated_at", "2019-04-08 10:31:41.315626"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:31:41.323776"], ["updated_at", "2019-04-08 10:31:41.323776"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.327856"], ["updated_at", "2019-04-08 10:31:41.327856"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:31:41.337191"], ["updated_at", "2019-04-08 10:31:41.337191"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.344190"], ["updated_at", "2019-04-08 10:31:41.344190"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.358412"], ["updated_at", "2019-04-08 10:31:41.358412"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.363079"], ["updated_at", "2019-04-08 10:31:41.363079"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1733], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:31:41.369439"], ["id", 1733]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.376422"], ["updated_at", "2019-04-08 10:31:41.376422"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.380569"], ["updated_at", "2019-04-08 10:31:41.380569"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1735], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:31:41.386354"], ["id", 1735]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1735], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.395445"], ["updated_at", "2019-04-08 10:31:41.395445"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.400132"], ["updated_at", "2019-04-08 10:31:41.400132"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1737], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:31:41.405976"], ["id", 1737]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1737], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.414433"], ["updated_at", "2019-04-08 10:31:41.414433"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.418749"], ["updated_at", "2019-04-08 10:31:41.418749"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.427062"], ["updated_at", "2019-04-08 10:31:41.427062"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.433390"], ["updated_at", "2019-04-08 10:31:41.433390"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.439910"], ["updated_at", "2019-04-08 10:31:41.439910"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.448912"], ["updated_at", "2019-04-08 10:31:41.448912"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:31:41.472642"], ["updated_at", "2019-04-08 10:31:41.472642"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:31:41.484204"], ["updated_at", "2019-04-08 10:31:41.484204"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1744], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1744], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:31:41.492479"], ["id", 1744]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1744], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.505518"], ["updated_at", "2019-04-08 10:31:41.505518"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.514170"], ["updated_at", "2019-04-08 10:31:41.514170"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:31:41.536408"], ["updated_at", "2019-04-08 10:31:41.536408"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.547946"], ["updated_at", "2019-04-08 10:31:41.547946"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.553080"], ["updated_at", "2019-04-08 10:31:41.553080"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:31:41.614416"], ["updated_at", "2019-04-08 10:31:41.614416"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 4.7ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:31:41.627559"], ["updated_at", "2019-04-08 10:31:41.627559"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.8ms)  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:31:41.642421"], ["updated_at", "2019-04-08 10:31:41.642421"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.6ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:31:41.658982"], ["updated_at", "2019-04-08 10:31:41.658982"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.4ms)  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.671126"], ["updated_at", "2019-04-08 10:31:41.671126"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.692339"], ["updated_at", "2019-04-08 10:31:41.692339"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.712934"], ["updated_at", "2019-04-08 10:31:41.712934"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.727907"], ["updated_at", "2019-04-08 10:31:41.727907"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.742559"], ["updated_at", "2019-04-08 10:31:41.742559"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.763710"], ["updated_at", "2019-04-08 10:31:41.763710"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.9ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:41.807802"], ["updated_at", "2019-04-08 10:31:41.807802"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:31:41.816720"], ["updated_at", "2019-04-08 10:31:41.816720"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633101"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1565], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2019-04-08 10:31:41.822306"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892301"], ["id", 1565]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.5ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1565]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:31:41.832977"], ["updated_at", "2019-04-08 10:31:41.832977"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554805901"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:31:41.845101"], ["updated_at", "2019-04-08 10:31:41.845101"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:31:41.850460"], ["updated_at", "2019-04-08 10:31:41.850460"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:31:41.857618"], ["updated_at", "2019-04-08 10:31:41.857618"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Account Load (1.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:31:41.877900"], ["updated_at", "2019-04-08 10:31:41.877900"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:31:41.882345"], ["synced_id", 0], ["id", 1570]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:31:41.898220"], ["updated_at", "2019-04-08 10:31:41.898220"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:31:41.906366"], ["updated_at", "2019-04-08 10:31:41.906366"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:31:41.914558"], ["updated_at", "2019-04-08 10:31:41.914558"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:31:41.922957"], ["updated_at", "2019-04-08 10:31:41.922957"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.944127"], ["updated_at", "2019-04-08 10:31:41.944127"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:31:41.949636"], ["updated_at", "2019-04-08 10:31:41.949636"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.957005"], ["updated_at", "2019-04-08 10:31:41.957005"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:31:41.962105"], ["updated_at", "2019-04-08 10:31:41.962105"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.969484"], ["updated_at", "2019-04-08 10:31:41.969484"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:31:41.975449"], ["updated_at", "2019-04-08 10:31:41.975449"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.981423"], ["updated_at", "2019-04-08 10:31:41.981423"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:31:41.985996"], ["updated_at", "2019-04-08 10:31:41.985996"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.993615"], ["updated_at", "2019-04-08 10:31:41.993615"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:41.997295"], ["updated_at", "2019-04-08 10:31:41.997295"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1583], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:31:42.002976"], ["id", 1583]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:42.011293"], ["updated_at", "2019-04-08 10:31:42.011293"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:42.015085"], ["updated_at", "2019-04-08 10:31:42.015085"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1585], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:31:42.020460"], ["id", 1585]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:42.027648"], ["updated_at", "2019-04-08 10:31:42.027648"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:42.031532"], ["updated_at", "2019-04-08 10:31:42.031532"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1587], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:31:42.037502"], ["id", 1587]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1587], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:42.048389"], ["updated_at", "2019-04-08 10:31:42.048389"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:31:42.052759"], ["updated_at", "2019-04-08 10:31:42.052759"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1589], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:31:42.058307"], ["id", 1589]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1589], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:31:42.067642"], ["updated_at", "2019-04-08 10:31:42.067642"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1590], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1590], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:31:42.074881"], ["id", 1590]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1590], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:33:28.080235"], ["updated_at", "2019-04-08 10:33:28.080235"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:33:28.103305"], ["updated_at", "2019-04-08 10:33:28.103305"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:33:28.114663"], ["updated_at", "2019-04-08 10:33:28.114663"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806008"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:33:28.122321"], ["updated_at", "2019-04-08 10:33:28.122321"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633208"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 Account Destroy (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1593]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.0ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:33:28.142665"], ["updated_at", "2019-04-08 10:33:28.142665"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:33:28.146039"], ["synced_id", 0], ["id", 1594]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.168275"], ["updated_at", "2019-04-08 10:33:28.168275"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:33:28.182512"], ["updated_at", "2019-04-08 10:33:28.182512"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.195692"], ["updated_at", "2019-04-08 10:33:28.195692"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:33:28.203062"], ["updated_at", "2019-04-08 10:33:28.203062"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.212244"], ["updated_at", "2019-04-08 10:33:28.212244"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:33:28.218909"], ["updated_at", "2019-04-08 10:33:28.218909"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.228291"], ["updated_at", "2019-04-08 10:33:28.228291"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:33:28.234531"], ["updated_at", "2019-04-08 10:33:28.234531"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.241446"], ["updated_at", "2019-04-08 10:33:28.241446"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.245406"], ["updated_at", "2019-04-08 10:33:28.245406"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (2.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1604], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:33:28.254440"], ["id", 1604]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.262253"], ["updated_at", "2019-04-08 10:33:28.262253"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.267721"], ["updated_at", "2019-04-08 10:33:28.267721"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1606], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:33:28.273592"], ["id", 1606]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.281057"], ["updated_at", "2019-04-08 10:33:28.281057"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.286490"], ["updated_at", "2019-04-08 10:33:28.286490"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1608], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:33:28.292631"], ["id", 1608]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1608], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.301380"], ["updated_at", "2019-04-08 10:33:28.301380"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.306403"], ["updated_at", "2019-04-08 10:33:28.306403"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1610], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:33:28.313825"], ["id", 1610]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1610], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.6ms) ROLLBACK  (1.0ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (3.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:33:28.342336"], ["updated_at", "2019-04-08 10:33:28.342336"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:33:28.373816"], ["updated_at", "2019-04-08 10:33:28.373816"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:33:28.379530"], ["updated_at", "2019-04-08 10:33:28.379530"], ["synced_id", 2]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:33:28.385521"], ["updated_at", "2019-04-08 10:33:28.385521"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:33:28.396268"], ["updated_at", "2019-04-08 10:33:28.396268"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.406353"], ["updated_at", "2019-04-08 10:33:28.406353"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1616], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1616], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:33:28.412089"], ["id", 1616]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1616], ["LIMIT", 1]]  (5.1ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.439566"], ["updated_at", "2019-04-08 10:33:28.439566"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.0ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 12ms (Views: 8.7ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:33:28.504013"], ["updated_at", "2019-04-08 10:33:28.504013"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:33:28.515479"], ["updated_at", "2019-04-08 10:33:28.515479"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 4.4ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:33:28.534195"], ["updated_at", "2019-04-08 10:33:28.534195"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 7.5ms)  (1.3ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:33:28.557289"], ["updated_at", "2019-04-08 10:33:28.557289"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 4.6ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.595763"], ["updated_at", "2019-04-08 10:33:28.595763"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.627712"], ["updated_at", "2019-04-08 10:33:28.627712"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.646259"], ["updated_at", "2019-04-08 10:33:28.646259"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.670693"], ["updated_at", "2019-04-08 10:33:28.670693"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.684751"], ["updated_at", "2019-04-08 10:33:28.684751"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.703658"], ["updated_at", "2019-04-08 10:33:28.703658"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.727014"], ["updated_at", "2019-04-08 10:33:28.727014"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.734467"], ["updated_at", "2019-04-08 10:33:28.734467"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.743214"], ["updated_at", "2019-04-08 10:33:28.743214"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.749647"], ["updated_at", "2019-04-08 10:33:28.749647"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.756114"], ["updated_at", "2019-04-08 10:33:28.756114"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.765646"], ["updated_at", "2019-04-08 10:33:28.765646"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.783865"], ["updated_at", "2019-04-08 10:33:28.783865"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.788390"], ["updated_at", "2019-04-08 10:33:28.788390"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.792276"], ["updated_at", "2019-04-08 10:33:28.792276"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:28.796733"], ["updated_at", "2019-04-08 10:33:28.796733"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:33:28.811433"], ["updated_at", "2019-04-08 10:33:28.811433"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.822887"], ["updated_at", "2019-04-08 10:33:28.822887"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.830415"], ["updated_at", "2019-04-08 10:33:28.830415"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:33:28.843633"], ["updated_at", "2019-04-08 10:33:28.843633"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.1ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:33:28.860183"], ["updated_at", "2019-04-08 10:33:28.860183"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.866098"], ["updated_at", "2019-04-08 10:33:28.866098"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:33:28.876292"], ["updated_at", "2019-04-08 10:33:28.876292"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.882635"], ["updated_at", "2019-04-08 10:33:28.882635"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:33:28.894241"], ["updated_at", "2019-04-08 10:33:28.894241"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.899796"], ["updated_at", "2019-04-08 10:33:28.899796"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.909475"], ["updated_at", "2019-04-08 10:33:28.909475"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.914572"], ["updated_at", "2019-04-08 10:33:28.914572"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1769], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:33:28.920955"], ["id", 1769]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.928725"], ["updated_at", "2019-04-08 10:33:28.928725"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.934365"], ["updated_at", "2019-04-08 10:33:28.934365"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1771], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:33:28.940023"], ["id", 1771]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1771], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.953227"], ["updated_at", "2019-04-08 10:33:28.953227"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:28.962199"], ["updated_at", "2019-04-08 10:33:28.962199"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1773], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.5ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:33:28.977639"], ["id", 1773]]  (2.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1773], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:29.000860"], ["updated_at", "2019-04-08 10:33:29.000860"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:29.007306"], ["updated_at", "2019-04-08 10:33:29.007306"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:33:29.019937"], ["updated_at", "2019-04-08 10:33:29.019937"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633209"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1777], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:33:29.026076"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892409"], ["id", 1777]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1777]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:33:29.038633"], ["updated_at", "2019-04-08 10:33:29.038633"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806009"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:29.046268"], ["updated_at", "2019-04-08 10:33:29.046268"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:29.053154"], ["updated_at", "2019-04-08 10:33:29.053154"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:33:29.073495"], ["updated_at", "2019-04-08 10:33:29.073495"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1780], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1780], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:33:29.078543"], ["id", 1780]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1780], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:33:29.088340"], ["updated_at", "2019-04-08 10:33:29.088340"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:33:29.099102"], ["updated_at", "2019-04-08 10:33:29.099102"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:29.108358"], ["updated_at", "2019-04-08 10:33:29.108358"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:33:29.112055"], ["updated_at", "2019-04-08 10:33:29.112055"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:01.835752"], ["updated_at", "2019-04-08 10:34:01.835752"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:01.894440"], ["updated_at", "2019-04-08 10:34:01.894440"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:01.919190"], ["updated_at", "2019-04-08 10:34:01.919190"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:01.936727"], ["updated_at", "2019-04-08 10:34:01.936727"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:01.962443"], ["updated_at", "2019-04-08 10:34:01.962443"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:01.991106"], ["updated_at", "2019-04-08 10:34:01.991106"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.014177"], ["updated_at", "2019-04-08 10:34:02.014177"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:02.040161"], ["updated_at", "2019-04-08 10:34:02.040161"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1783], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1783], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:34:02.050297"], ["id", 1783]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1783], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:34:02.060864"], ["updated_at", "2019-04-08 10:34:02.060864"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806042"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:34:02.068629"], ["updated_at", "2019-04-08 10:34:02.068629"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633242"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1785], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:34:02.074625"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892442"], ["id", 1785]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.6ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1785]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.086663"], ["updated_at", "2019-04-08 10:34:02.086663"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.099994"], ["updated_at", "2019-04-08 10:34:02.099994"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.107157"], ["updated_at", "2019-04-08 10:34:02.107157"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.115076"], ["updated_at", "2019-04-08 10:34:02.115076"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.122471"], ["updated_at", "2019-04-08 10:34:02.122471"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.131016"], ["updated_at", "2019-04-08 10:34:02.131016"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.141586"], ["updated_at", "2019-04-08 10:34:02.141586"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.148091"], ["updated_at", "2019-04-08 10:34:02.148091"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.173477"], ["updated_at", "2019-04-08 10:34:02.173477"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.189727"], ["updated_at", "2019-04-08 10:34:02.189727"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.193567"], ["updated_at", "2019-04-08 10:34:02.193567"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.202250"], ["updated_at", "2019-04-08 10:34:02.202250"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.207372"], ["updated_at", "2019-04-08 10:34:02.207372"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:02.214041"], ["updated_at", "2019-04-08 10:34:02.214041"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:02.224120"], ["updated_at", "2019-04-08 10:34:02.224120"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.227964"], ["updated_at", "2019-04-08 10:34:02.227964"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:02.236962"], ["updated_at", "2019-04-08 10:34:02.236962"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.241162"], ["updated_at", "2019-04-08 10:34:02.241162"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:02.248939"], ["updated_at", "2019-04-08 10:34:02.248939"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.253583"], ["updated_at", "2019-04-08 10:34:02.253583"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.261852"], ["updated_at", "2019-04-08 10:34:02.261852"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.266213"], ["updated_at", "2019-04-08 10:34:02.266213"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1801], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:02.272812"], ["id", 1801]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.280154"], ["updated_at", "2019-04-08 10:34:02.280154"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.284572"], ["updated_at", "2019-04-08 10:34:02.284572"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1803], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:02.296713"], ["id", 1803]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1803], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.306488"], ["updated_at", "2019-04-08 10:34:02.306488"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.311062"], ["updated_at", "2019-04-08 10:34:02.311062"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1805], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:02.316776"], ["id", 1805]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1805], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:02.325008"], ["updated_at", "2019-04-08 10:34:02.325008"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.331329"], ["updated_at", "2019-04-08 10:34:02.331329"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.336739"], ["updated_at", "2019-04-08 10:34:02.336739"], ["synced_id", 2], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.347660"], ["updated_at", "2019-04-08 10:34:02.347660"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.353606"], ["updated_at", "2019-04-08 10:34:02.353606"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.368208"], ["updated_at", "2019-04-08 10:34:02.368208"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.372893"], ["updated_at", "2019-04-08 10:34:02.372893"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:02.394697"], ["updated_at", "2019-04-08 10:34:02.394697"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:02.407620"], ["updated_at", "2019-04-08 10:34:02.407620"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1622], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1622], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:34:02.414213"], ["id", 1622]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1622], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:02.423186"], ["updated_at", "2019-04-08 10:34:02.423186"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:02.430152"], ["updated_at", "2019-04-08 10:34:02.430152"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:02.450390"], ["updated_at", "2019-04-08 10:34:02.450390"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:02.463631"], ["updated_at", "2019-04-08 10:34:02.463631"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.472471"], ["updated_at", "2019-04-08 10:34:02.472471"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.476752"], ["updated_at", "2019-04-08 10:34:02.476752"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1627], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:02.482883"], ["id", 1627]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.490070"], ["updated_at", "2019-04-08 10:34:02.490070"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.493783"], ["updated_at", "2019-04-08 10:34:02.493783"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1629], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:02.498977"], ["id", 1629]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1629], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.507006"], ["updated_at", "2019-04-08 10:34:02.507006"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.510521"], ["updated_at", "2019-04-08 10:34:02.510521"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1631], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:02.514953"], ["id", 1631]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1631], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.523522"], ["updated_at", "2019-04-08 10:34:02.523522"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.527410"], ["updated_at", "2019-04-08 10:34:02.527410"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1633], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:02.532450"], ["id", 1633]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.539952"], ["updated_at", "2019-04-08 10:34:02.539952"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:02.545503"], ["updated_at", "2019-04-08 10:34:02.545503"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.553422"], ["updated_at", "2019-04-08 10:34:02.553422"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:02.559140"], ["updated_at", "2019-04-08 10:34:02.559140"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.565708"], ["updated_at", "2019-04-08 10:34:02.565708"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:02.571640"], ["updated_at", "2019-04-08 10:34:02.571640"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:02.578347"], ["updated_at", "2019-04-08 10:34:02.578347"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:02.583415"], ["updated_at", "2019-04-08 10:34:02.583415"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:34:02.597168"], ["updated_at", "2019-04-08 10:34:02.597168"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:34:02.600878"], ["synced_id", 0], ["id", 1642]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:02.613634"], ["updated_at", "2019-04-08 10:34:02.613634"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:02.618323"], ["updated_at", "2019-04-08 10:34:02.618323"], ["synced_id", 2]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:02.624467"], ["updated_at", "2019-04-08 10:34:02.624467"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:02.633923"], ["updated_at", "2019-04-08 10:34:02.633923"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633242"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts"  (1.0ms) SAVEPOINT active_record_1 Account Destroy (1.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1646]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:02.660110"], ["updated_at", "2019-04-08 10:34:02.660110"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806042"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:02.685389"], ["updated_at", "2019-04-08 10:34:02.685389"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.8ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:02.697846"], ["updated_at", "2019-04-08 10:34:02.697846"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 4.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:02.710202"], ["updated_at", "2019-04-08 10:34:02.710202"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.4ms)  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:02.726333"], ["updated_at", "2019-04-08 10:34:02.726333"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.9ms)  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.4ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.459503"], ["updated_at", "2019-04-08 10:34:41.459503"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (5.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.486774"], ["updated_at", "2019-04-08 10:34:41.486774"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.526473"], ["updated_at", "2019-04-08 10:34:41.526473"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.552239"], ["updated_at", "2019-04-08 10:34:41.552239"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.579629"], ["updated_at", "2019-04-08 10:34:41.579629"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.595844"], ["updated_at", "2019-04-08 10:34:41.595844"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 4.0ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:41.692902"], ["updated_at", "2019-04-08 10:34:41.692902"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 31ms (ActiveRecord: 10.5ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:41.708894"], ["updated_at", "2019-04-08 10:34:41.708894"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:41.749820"], ["updated_at", "2019-04-08 10:34:41.749820"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 7.9ms)  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:41.767566"], ["updated_at", "2019-04-08 10:34:41.767566"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 6ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:34:41.807088"], ["updated_at", "2019-04-08 10:34:41.807088"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806081"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:34:41.816014"], ["updated_at", "2019-04-08 10:34:41.816014"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633281"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1818], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:34:41.822729"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892481"], ["id", 1818]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1818]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:41.834789"], ["updated_at", "2019-04-08 10:34:41.834789"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.845381"], ["updated_at", "2019-04-08 10:34:41.845381"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.850662"], ["updated_at", "2019-04-08 10:34:41.850662"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.861123"], ["updated_at", "2019-04-08 10:34:41.861123"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.865991"], ["updated_at", "2019-04-08 10:34:41.865991"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1822], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:41.872401"], ["id", 1822]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.881163"], ["updated_at", "2019-04-08 10:34:41.881163"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.886839"], ["updated_at", "2019-04-08 10:34:41.886839"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1824], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:41.893371"], ["id", 1824]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1824], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.903676"], ["updated_at", "2019-04-08 10:34:41.903676"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.908178"], ["updated_at", "2019-04-08 10:34:41.908178"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1826], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:41.913893"], ["id", 1826]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1826], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.922887"], ["updated_at", "2019-04-08 10:34:41.922887"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.927445"], ["updated_at", "2019-04-08 10:34:41.927445"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:41.935339"], ["updated_at", "2019-04-08 10:34:41.935339"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:41.947435"], ["updated_at", "2019-04-08 10:34:41.947435"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.951665"], ["updated_at", "2019-04-08 10:34:41.951665"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.4ms) BEGIN MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:41.966522"], ["updated_at", "2019-04-08 10:34:41.966522"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.973850"], ["updated_at", "2019-04-08 10:34:41.973850"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:34:41.989810"], ["updated_at", "2019-04-08 10:34:41.989810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:41.996317"], ["updated_at", "2019-04-08 10:34:41.996317"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.005372"], ["updated_at", "2019-04-08 10:34:42.005372"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.010873"], ["updated_at", "2019-04-08 10:34:42.010873"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.016139"], ["updated_at", "2019-04-08 10:34:42.016139"], ["synced_id", 1], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.021622"], ["updated_at", "2019-04-08 10:34:42.021622"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.032326"], ["updated_at", "2019-04-08 10:34:42.032326"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.051385"], ["updated_at", "2019-04-08 10:34:42.051385"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.062221"], ["updated_at", "2019-04-08 10:34:42.062221"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.069836"], ["updated_at", "2019-04-08 10:34:42.069836"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:42.080435"], ["updated_at", "2019-04-08 10:34:42.080435"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1843], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1843], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:34:42.086934"], ["id", 1843]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1843], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.096284"], ["updated_at", "2019-04-08 10:34:42.096284"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.103069"], ["updated_at", "2019-04-08 10:34:42.103069"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.111473"], ["updated_at", "2019-04-08 10:34:42.111473"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.118100"], ["updated_at", "2019-04-08 10:34:42.118100"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.146860"], ["updated_at", "2019-04-08 10:34:42.146860"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:42.173340"], ["updated_at", "2019-04-08 10:34:42.173340"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:34:42.184625"], ["updated_at", "2019-04-08 10:34:42.184625"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:34:42.188833"], ["synced_id", 0], ["id", 1655]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:42.200173"], ["updated_at", "2019-04-08 10:34:42.200173"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:42.204619"], ["updated_at", "2019-04-08 10:34:42.204619"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:42.208712"], ["updated_at", "2019-04-08 10:34:42.208712"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.222180"], ["updated_at", "2019-04-08 10:34:42.222180"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.226163"], ["updated_at", "2019-04-08 10:34:42.226163"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1660], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:42.231538"], ["id", 1660]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.239489"], ["updated_at", "2019-04-08 10:34:42.239489"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.242920"], ["updated_at", "2019-04-08 10:34:42.242920"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1662], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:42.248050"], ["id", 1662]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1662], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.258261"], ["updated_at", "2019-04-08 10:34:42.258261"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.262401"], ["updated_at", "2019-04-08 10:34:42.262401"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1664], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:42.268520"], ["id", 1664]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1664], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.276383"], ["updated_at", "2019-04-08 10:34:42.276383"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.280394"], ["updated_at", "2019-04-08 10:34:42.280394"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1666], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:34:42.285872"], ["id", 1666]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.292671"], ["updated_at", "2019-04-08 10:34:42.292671"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:42.298942"], ["updated_at", "2019-04-08 10:34:42.298942"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.307584"], ["updated_at", "2019-04-08 10:34:42.307584"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:42.313056"], ["updated_at", "2019-04-08 10:34:42.313056"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.320394"], ["updated_at", "2019-04-08 10:34:42.320394"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:42.325182"], ["updated_at", "2019-04-08 10:34:42.325182"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.331443"], ["updated_at", "2019-04-08 10:34:42.331443"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:34:42.337010"], ["updated_at", "2019-04-08 10:34:42.337010"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.343650"], ["updated_at", "2019-04-08 10:34:42.343650"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1675], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1675], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:34:42.349806"], ["id", 1675]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1675], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:42.358211"], ["updated_at", "2019-04-08 10:34:42.358211"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:42.380815"], ["updated_at", "2019-04-08 10:34:42.380815"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633282"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts"  (1.0ms) SAVEPOINT active_record_1 Account Destroy (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1677]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:42.406803"], ["updated_at", "2019-04-08 10:34:42.406803"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806082"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:42.413024"], ["updated_at", "2019-04-08 10:34:42.413024"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:34:42.419634"], ["updated_at", "2019-04-08 10:34:42.419634"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:34:42.428989"], ["updated_at", "2019-04-08 10:34:42.428989"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.438411"], ["updated_at", "2019-04-08 10:34:42.438411"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:34:42.442207"], ["updated_at", "2019-04-08 10:34:42.442207"], ["synced_id", 123], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:34:42.452326"], ["updated_at", "2019-04-08 10:34:42.452326"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:25.921701"], ["updated_at", "2019-04-08 10:35:25.921701"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:25.940376"], ["updated_at", "2019-04-08 10:35:25.940376"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:25.985799"], ["updated_at", "2019-04-08 10:35:25.985799"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.004445"], ["updated_at", "2019-04-08 10:35:26.004445"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.021398"], ["updated_at", "2019-04-08 10:35:26.021398"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.044744"], ["updated_at", "2019-04-08 10:35:26.044744"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.4ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:35:26.112423"], ["updated_at", "2019-04-08 10:35:26.112423"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 23ms (ActiveRecord: 10.5ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:35:26.129889"], ["updated_at", "2019-04-08 10:35:26.129889"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 6.5ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:35:26.161584"], ["updated_at", "2019-04-08 10:35:26.161584"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 7.2ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:35:26.181296"], ["updated_at", "2019-04-08 10:35:26.181296"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.1ms)  (0.9ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:35:26.228209"], ["updated_at", "2019-04-08 10:35:26.228209"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:35:26.246616"], ["updated_at", "2019-04-08 10:35:26.246616"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:35:26.253723"], ["updated_at", "2019-04-08 10:35:26.253723"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633326"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1685], ["LIMIT", 1]] Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-08 10:35:26.274910"], ["oauth_access_token", "the_access_token"], ["oauth_expires_at", nil], ["id", 1685]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1685]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:35:26.286028"], ["updated_at", "2019-04-08 10:35:26.286028"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806126"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.292560"], ["updated_at", "2019-04-08 10:35:26.292560"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1687], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1687], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:35:26.298575"], ["id", 1687]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1687], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.306219"], ["updated_at", "2019-04-08 10:35:26.306219"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.310331"], ["updated_at", "2019-04-08 10:35:26.310331"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1689], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:35:26.316061"], ["id", 1689]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1689], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.324362"], ["updated_at", "2019-04-08 10:35:26.324362"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.328882"], ["updated_at", "2019-04-08 10:35:26.328882"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1691], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:35:26.334730"], ["id", 1691]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1691], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.343933"], ["updated_at", "2019-04-08 10:35:26.343933"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.348543"], ["updated_at", "2019-04-08 10:35:26.348543"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1693], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:35:26.355201"], ["id", 1693]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.367726"], ["updated_at", "2019-04-08 10:35:26.367726"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.373462"], ["updated_at", "2019-04-08 10:35:26.373462"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1695], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:35:26.379559"], ["id", 1695]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.387246"], ["updated_at", "2019-04-08 10:35:26.387246"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:35:26.394422"], ["updated_at", "2019-04-08 10:35:26.394422"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.402955"], ["updated_at", "2019-04-08 10:35:26.402955"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:35:26.408679"], ["updated_at", "2019-04-08 10:35:26.408679"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.422087"], ["updated_at", "2019-04-08 10:35:26.422087"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:35:26.429380"], ["updated_at", "2019-04-08 10:35:26.429380"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.437418"], ["updated_at", "2019-04-08 10:35:26.437418"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:35:26.442998"], ["updated_at", "2019-04-08 10:35:26.442998"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:35:26.451829"], ["updated_at", "2019-04-08 10:35:26.451829"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:35:26.458588"], ["updated_at", "2019-04-08 10:35:26.458588"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:35:26.463285"], ["updated_at", "2019-04-08 10:35:26.463285"], ["synced_id", 2]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:35:26.467310"], ["updated_at", "2019-04-08 10:35:26.467310"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:35:26.482309"], ["updated_at", "2019-04-08 10:35:26.482309"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (2.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:35:26.486263"], ["synced_id", 0], ["id", 1708]]  (2.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:35:26.502242"], ["updated_at", "2019-04-08 10:35:26.502242"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.543698"], ["updated_at", "2019-04-08 10:35:26.543698"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.549596"], ["updated_at", "2019-04-08 10:35:26.549596"], ["synced_id", 2], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.554341"], ["updated_at", "2019-04-08 10:35:26.554341"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.558888"], ["updated_at", "2019-04-08 10:35:26.558888"], ["synced_id", 2], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.568276"], ["updated_at", "2019-04-08 10:35:26.568276"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.573874"], ["updated_at", "2019-04-08 10:35:26.573874"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.600804"], ["updated_at", "2019-04-08 10:35:26.600804"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.609918"], ["updated_at", "2019-04-08 10:35:26.609918"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.617742"], ["updated_at", "2019-04-08 10:35:26.617742"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:35:26.626215"], ["updated_at", "2019-04-08 10:35:26.626215"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633326"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1857], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:35:26.633754"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892526"], ["id", 1857]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.7ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1857]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:35:26.645643"], ["updated_at", "2019-04-08 10:35:26.645643"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806126"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:35:26.653572"], ["updated_at", "2019-04-08 10:35:26.653572"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1859], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1859], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:35:26.660006"], ["id", 1859]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1859], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (4.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.675547"], ["updated_at", "2019-04-08 10:35:26.675547"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:35:26.696884"], ["updated_at", "2019-04-08 10:35:26.696884"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.706008"], ["updated_at", "2019-04-08 10:35:26.706008"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.711720"], ["updated_at", "2019-04-08 10:35:26.711720"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:35:26.719478"], ["updated_at", "2019-04-08 10:35:26.719478"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:35:26.730964"], ["updated_at", "2019-04-08 10:35:26.730964"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.735897"], ["updated_at", "2019-04-08 10:35:26.735897"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:35:26.745655"], ["updated_at", "2019-04-08 10:35:26.745655"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.751100"], ["updated_at", "2019-04-08 10:35:26.751100"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:35:26.761195"], ["updated_at", "2019-04-08 10:35:26.761195"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.766515"], ["updated_at", "2019-04-08 10:35:26.766515"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.774708"], ["updated_at", "2019-04-08 10:35:26.774708"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.780597"], ["updated_at", "2019-04-08 10:35:26.780597"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1871], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:35:26.786967"], ["id", 1871]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.796603"], ["updated_at", "2019-04-08 10:35:26.796603"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.801053"], ["updated_at", "2019-04-08 10:35:26.801053"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1873], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:35:26.806371"], ["id", 1873]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1873], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.815428"], ["updated_at", "2019-04-08 10:35:26.815428"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.819370"], ["updated_at", "2019-04-08 10:35:26.819370"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1875], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:35:26.824051"], ["id", 1875]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1875], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.832189"], ["updated_at", "2019-04-08 10:35:26.832189"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.836695"], ["updated_at", "2019-04-08 10:35:26.836695"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.848109"], ["updated_at", "2019-04-08 10:35:26.848109"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.858544"], ["updated_at", "2019-04-08 10:35:26.858544"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.866371"], ["updated_at", "2019-04-08 10:35:26.866371"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (2.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.7ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:35:26.885924"], ["updated_at", "2019-04-08 10:35:26.885924"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.908165"], ["updated_at", "2019-04-08 10:35:26.908165"], ["synced_id", 123], ["host", "example.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:35:26.913502"], ["updated_at", "2019-04-08 10:35:26.913502"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:35:26.923004"], ["updated_at", "2019-04-08 10:35:26.923004"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:06.895615"], ["updated_at", "2019-04-08 10:36:06.895615"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:06.929839"], ["updated_at", "2019-04-08 10:36:06.929839"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (2.5ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:06.956197"], ["updated_at", "2019-04-08 10:36:06.956197"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:06.976164"], ["updated_at", "2019-04-08 10:36:06.976164"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:06.993665"], ["updated_at", "2019-04-08 10:36:06.993665"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.018494"], ["updated_at", "2019-04-08 10:36:07.018494"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.054413"], ["updated_at", "2019-04-08 10:36:07.054413"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:36:07.105319"], ["updated_at", "2019-04-08 10:36:07.105319"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.118598"], ["updated_at", "2019-04-08 10:36:07.118598"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:36:07.138664"], ["updated_at", "2019-04-08 10:36:07.138664"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633367"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1884], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:36:07.144921"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892567"], ["id", 1884]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.8ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1884]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:36:07.157533"], ["updated_at", "2019-04-08 10:36:07.157533"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806167"], ["host", "example.test"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (2.2ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.177099"], ["updated_at", "2019-04-08 10:36:07.177099"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.183532"], ["updated_at", "2019-04-08 10:36:07.183532"], ["synced_id", 2], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.189577"], ["updated_at", "2019-04-08 10:36:07.189577"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.197985"], ["updated_at", "2019-04-08 10:36:07.197985"], ["synced_id", 2], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.214113"], ["updated_at", "2019-04-08 10:36:07.214113"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.224023"], ["updated_at", "2019-04-08 10:36:07.224023"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (2.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.239027"], ["updated_at", "2019-04-08 10:36:07.239027"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Application Load (2.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.6ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (2.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.267474"], ["updated_at", "2019-04-08 10:36:07.267474"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (2.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (2.1ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.300243"], ["updated_at", "2019-04-08 10:36:07.300243"], ["synced_id", 123], ["host", "test.example"]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.316073"], ["updated_at", "2019-04-08 10:36:07.316073"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.329825"], ["updated_at", "2019-04-08 10:36:07.329825"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.335464"], ["updated_at", "2019-04-08 10:36:07.335464"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (2.0ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.360270"], ["updated_at", "2019-04-08 10:36:07.360270"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.368282"], ["updated_at", "2019-04-08 10:36:07.368282"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1894], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.3ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:36:07.378490"], ["id", 1894]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (2.5ms) ROLLBACK  (1.4ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.400133"], ["updated_at", "2019-04-08 10:36:07.400133"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.406455"], ["updated_at", "2019-04-08 10:36:07.406455"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1896], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:36:07.414163"], ["id", 1896]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1896], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.425903"], ["updated_at", "2019-04-08 10:36:07.425903"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.431412"], ["updated_at", "2019-04-08 10:36:07.431412"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1898], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:36:07.439023"], ["id", 1898]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1898], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.450274"], ["updated_at", "2019-04-08 10:36:07.450274"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.456115"], ["updated_at", "2019-04-08 10:36:07.456115"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:36:07.466154"], ["updated_at", "2019-04-08 10:36:07.466154"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:36:07.476987"], ["updated_at", "2019-04-08 10:36:07.476987"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.481067"], ["updated_at", "2019-04-08 10:36:07.481067"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:36:07.489352"], ["updated_at", "2019-04-08 10:36:07.489352"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.493127"], ["updated_at", "2019-04-08 10:36:07.493127"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:36:07.500872"], ["updated_at", "2019-04-08 10:36:07.500872"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.505919"], ["updated_at", "2019-04-08 10:36:07.505919"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:36:07.513872"], ["updated_at", "2019-04-08 10:36:07.513872"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1909], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1909], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.5ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:36:07.519682"], ["id", 1909]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1909], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.531943"], ["updated_at", "2019-04-08 10:36:07.531943"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:07.540480"], ["updated_at", "2019-04-08 10:36:07.540480"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.575869"], ["updated_at", "2019-04-08 10:36:07.575869"], ["synced_id", 123], ["host", "example.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.580091"], ["updated_at", "2019-04-08 10:36:07.580091"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:36:07.608039"], ["updated_at", "2019-04-08 10:36:07.608039"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:36:07.644154"], ["updated_at", "2019-04-08 10:36:07.644154"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 4.2ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:36:07.659047"], ["updated_at", "2019-04-08 10:36:07.659047"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 4.3ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:36:07.676407"], ["updated_at", "2019-04-08 10:36:07.676407"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.4ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:36:07.704632"], ["updated_at", "2019-04-08 10:36:07.704632"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17ms (ActiveRecord: 5.5ms)  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.3ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:36:07.768810"], ["updated_at", "2019-04-08 10:36:07.768810"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806167"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:36:07.781362"], ["updated_at", "2019-04-08 10:36:07.781362"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633367"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1716], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-08 10:36:07.810513"], ["oauth_access_token", "the_access_token"], ["oauth_expires_at", nil], ["id", 1716]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.4ms) SELECT "accounts".* FROM "accounts"  (1.5ms) SAVEPOINT active_record_1 Account Destroy (1.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1716]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:36:07.832501"], ["updated_at", "2019-04-08 10:36:07.832501"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (3.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.846289"], ["updated_at", "2019-04-08 10:36:07.846289"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.851378"], ["updated_at", "2019-04-08 10:36:07.851378"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1719], ["LIMIT", 1]] Account Update (2.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:36:07.861073"], ["id", 1719]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.880168"], ["updated_at", "2019-04-08 10:36:07.880168"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.886441"], ["updated_at", "2019-04-08 10:36:07.886441"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1721], ["LIMIT", 1]] Account Update (1.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:36:07.893345"], ["id", 1721]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1721], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.904589"], ["updated_at", "2019-04-08 10:36:07.904589"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.908788"], ["updated_at", "2019-04-08 10:36:07.908788"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1723], ["LIMIT", 1]] Account Update (2.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:36:07.918758"], ["id", 1723]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1723], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.937428"], ["updated_at", "2019-04-08 10:36:07.937428"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.942482"], ["updated_at", "2019-04-08 10:36:07.942482"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1725], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:36:07.951561"], ["id", 1725]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.961008"], ["updated_at", "2019-04-08 10:36:07.961008"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:36:07.969223"], ["updated_at", "2019-04-08 10:36:07.969223"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.979671"], ["updated_at", "2019-04-08 10:36:07.979671"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:36:07.985713"], ["updated_at", "2019-04-08 10:36:07.985713"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:07.994101"], ["updated_at", "2019-04-08 10:36:07.994101"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:36:08.000725"], ["updated_at", "2019-04-08 10:36:08.000725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:36:08.008954"], ["updated_at", "2019-04-08 10:36:08.008954"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.5ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:36:08.018601"], ["updated_at", "2019-04-08 10:36:08.018601"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:36:08.029257"], ["updated_at", "2019-04-08 10:36:08.029257"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:36:08.043810"], ["updated_at", "2019-04-08 10:36:08.043810"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:36:08.048345"], ["synced_id", 0], ["id", 1734]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:36:08.060928"], ["updated_at", "2019-04-08 10:36:08.060928"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1735], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1735], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:36:08.067035"], ["id", 1735]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1735], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:36:08.076320"], ["updated_at", "2019-04-08 10:36:08.076320"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:36:08.080450"], ["updated_at", "2019-04-08 10:36:08.080450"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:36:08.084594"], ["updated_at", "2019-04-08 10:36:08.084594"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:36:08.096803"], ["updated_at", "2019-04-08 10:36:08.096803"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:36:08.120526"], ["updated_at", "2019-04-08 10:36:08.120526"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (3.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.351829"], ["updated_at", "2019-04-08 10:39:10.351829"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (1.6ms) ROLLBACK  (1.3ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:10.403552"], ["updated_at", "2019-04-08 10:39:10.403552"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.431446"], ["updated_at", "2019-04-08 10:39:10.431446"], ["synced_id", 123], ["host", "example.host"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.438933"], ["updated_at", "2019-04-08 10:39:10.438933"], ["synced_id", 123], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:10.489594"], ["updated_at", "2019-04-08 10:39:10.489594"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 4.6ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:10.501741"], ["updated_at", "2019-04-08 10:39:10.501741"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.5ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:10.518994"], ["updated_at", "2019-04-08 10:39:10.518994"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 4.3ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:10.536642"], ["updated_at", "2019-04-08 10:39:10.536642"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.8ms)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.548063"], ["updated_at", "2019-04-08 10:39:10.548063"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.554950"], ["updated_at", "2019-04-08 10:39:10.554950"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.560827"], ["updated_at", "2019-04-08 10:39:10.560827"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.569580"], ["updated_at", "2019-04-08 10:39:10.569580"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.602937"], ["updated_at", "2019-04-08 10:39:10.602937"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.612233"], ["updated_at", "2019-04-08 10:39:10.612233"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.643384"], ["updated_at", "2019-04-08 10:39:10.643384"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.651649"], ["updated_at", "2019-04-08 10:39:10.651649"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:10.662354"], ["updated_at", "2019-04-08 10:39:10.662354"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1922], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1922], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:39:10.670914"], ["id", 1922]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1922], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.679883"], ["updated_at", "2019-04-08 10:39:10.679883"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.685171"], ["updated_at", "2019-04-08 10:39:10.685171"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1923], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:10.691001"], ["id", 1923]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.699421"], ["updated_at", "2019-04-08 10:39:10.699421"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.703843"], ["updated_at", "2019-04-08 10:39:10.703843"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1925], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.6ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:10.709638"], ["id", 1925]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1925], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.722712"], ["updated_at", "2019-04-08 10:39:10.722712"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.727592"], ["updated_at", "2019-04-08 10:39:10.727592"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1927], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:10.737227"], ["id", 1927]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1927], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.750374"], ["updated_at", "2019-04-08 10:39:10.750374"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.755234"], ["updated_at", "2019-04-08 10:39:10.755234"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:10.763669"], ["updated_at", "2019-04-08 10:39:10.763669"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:10.777843"], ["updated_at", "2019-04-08 10:39:10.777843"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.782913"], ["updated_at", "2019-04-08 10:39:10.782913"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.3ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:10.796367"], ["updated_at", "2019-04-08 10:39:10.796367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.801756"], ["updated_at", "2019-04-08 10:39:10.801756"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:10.809781"], ["updated_at", "2019-04-08 10:39:10.809781"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.813827"], ["updated_at", "2019-04-08 10:39:10.813827"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.820244"], ["updated_at", "2019-04-08 10:39:10.820244"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.824262"], ["updated_at", "2019-04-08 10:39:10.824262"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:39:10.831795"], ["updated_at", "2019-04-08 10:39:10.831795"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633550"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1940], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:39:10.837009"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892750"], ["id", 1940]]  (2.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (3.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (1.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (1.4ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1940]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:39:10.857403"], ["updated_at", "2019-04-08 10:39:10.857403"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806350"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.871231"], ["updated_at", "2019-04-08 10:39:10.871231"], ["synced_id", 1], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.883066"], ["updated_at", "2019-04-08 10:39:10.883066"], ["synced_id", 2], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.890596"], ["updated_at", "2019-04-08 10:39:10.890596"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:10.897014"], ["updated_at", "2019-04-08 10:39:10.897014"], ["synced_id", 2], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (2.0ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:10.917288"], ["updated_at", "2019-04-08 10:39:10.917288"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.930044"], ["updated_at", "2019-04-08 10:39:10.930044"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.5ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Application Exists (3.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.956687"], ["updated_at", "2019-04-08 10:39:10.956687"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:10.983687"], ["updated_at", "2019-04-08 10:39:10.983687"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.7ms) ROLLBACK  (2.0ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:11.015082"], ["updated_at", "2019-04-08 10:39:11.015082"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:11.038020"], ["updated_at", "2019-04-08 10:39:11.038020"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:11.057836"], ["updated_at", "2019-04-08 10:39:11.057836"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:11.085238"], ["updated_at", "2019-04-08 10:39:11.085238"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:11.151380"], ["updated_at", "2019-04-08 10:39:11.151380"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1745], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1745], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:39:11.159766"], ["id", 1745]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1745], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:11.169225"], ["updated_at", "2019-04-08 10:39:11.169225"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.192755"], ["updated_at", "2019-04-08 10:39:11.192755"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.197425"], ["updated_at", "2019-04-08 10:39:11.197425"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1748], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:11.204195"], ["id", 1748]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.215748"], ["updated_at", "2019-04-08 10:39:11.215748"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.219244"], ["updated_at", "2019-04-08 10:39:11.219244"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1750], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:11.224699"], ["id", 1750]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1750], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.232013"], ["updated_at", "2019-04-08 10:39:11.232013"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.236621"], ["updated_at", "2019-04-08 10:39:11.236621"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1752], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:11.244394"], ["id", 1752]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1752], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.253676"], ["updated_at", "2019-04-08 10:39:11.253676"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.261758"], ["updated_at", "2019-04-08 10:39:11.261758"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1754], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:11.267672"], ["id", 1754]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.275992"], ["updated_at", "2019-04-08 10:39:11.275992"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:11.282992"], ["updated_at", "2019-04-08 10:39:11.282992"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.293887"], ["updated_at", "2019-04-08 10:39:11.293887"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.6ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:11.307721"], ["updated_at", "2019-04-08 10:39:11.307721"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.318179"], ["updated_at", "2019-04-08 10:39:11.318179"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:11.325126"], ["updated_at", "2019-04-08 10:39:11.325126"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:11.333764"], ["updated_at", "2019-04-08 10:39:11.333764"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:11.342153"], ["updated_at", "2019-04-08 10:39:11.342153"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:11.353369"], ["updated_at", "2019-04-08 10:39:11.353369"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:11.363926"], ["updated_at", "2019-04-08 10:39:11.363926"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:11.372322"], ["updated_at", "2019-04-08 10:39:11.372322"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633551"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1764], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-08 10:39:11.397926"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1764]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SAVEPOINT active_record_1 Account Destroy (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1764]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:11.409328"], ["updated_at", "2019-04-08 10:39:11.409328"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806351"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:11.416349"], ["updated_at", "2019-04-08 10:39:11.416349"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:11.421054"], ["updated_at", "2019-04-08 10:39:11.421054"], ["synced_id", 2]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 Account Exists (3.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (2.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:11.433891"], ["updated_at", "2019-04-08 10:39:11.433891"], ["synced_id", 3]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:39:11.457897"], ["updated_at", "2019-04-08 10:39:11.457897"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:39:11.461354"], ["synced_id", 0], ["id", 1769]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (2.0ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:11.484419"], ["updated_at", "2019-04-08 10:39:11.484419"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.9ms) ROLLBACK  (1.6ms) BEGIN  (1.9ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 6.1ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:36.651998"], ["updated_at", "2019-04-08 10:39:36.651998"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 47ms (ActiveRecord: 14.6ms)  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:36.668848"], ["updated_at", "2019-04-08 10:39:36.668848"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 16ms (ActiveRecord: 9.0ms)  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:36.702221"], ["updated_at", "2019-04-08 10:39:36.702221"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.3ms)  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (2.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:36.761617"], ["updated_at", "2019-04-08 10:39:36.761617"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 32ms (ActiveRecord: 8.0ms)  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (1.2ms) BEGIN  (1.7ms) ROLLBACK  (1.5ms) BEGIN  (1.5ms) ROLLBACK  (1.7ms) BEGIN  (1.5ms) ROLLBACK  (2.1ms) BEGIN  (1.8ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:36.890961"], ["updated_at", "2019-04-08 10:39:36.890961"], ["synced_id", 123], ["host", "test.example"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:36.903779"], ["updated_at", "2019-04-08 10:39:36.903779"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:36.914515"], ["updated_at", "2019-04-08 10:39:36.914515"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.4ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:36.931890"], ["updated_at", "2019-04-08 10:39:36.931890"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1950], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1950], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.3ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:39:36.945261"], ["id", 1950]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1950], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (3.4ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (2.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:36.975506"], ["updated_at", "2019-04-08 10:39:36.975506"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (2.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (3.5ms) ROLLBACK  (2.8ms) BEGIN  (2.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.010707"], ["updated_at", "2019-04-08 10:39:37.010707"], ["synced_id", 123], ["host", "test.example"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.021461"], ["updated_at", "2019-04-08 10:39:37.021461"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:37.034188"], ["updated_at", "2019-04-08 10:39:37.034188"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:39:37.046249"], ["updated_at", "2019-04-08 10:39:37.046249"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633577"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1953], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["updated_at", "2019-04-08 10:39:37.053041"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1554892777"], ["id", 1953]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts"  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Destroy (0.9ms) DELETE FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 [["id", 1953]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:39:37.067025"], ["updated_at", "2019-04-08 10:39:37.067025"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806377"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.075637"], ["updated_at", "2019-04-08 10:39:37.075637"], ["synced_id", 1], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.080353"], ["updated_at", "2019-04-08 10:39:37.080353"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.085331"], ["updated_at", "2019-04-08 10:39:37.085331"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.090086"], ["updated_at", "2019-04-08 10:39:37.090086"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.100217"], ["updated_at", "2019-04-08 10:39:37.100217"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.108731"], ["updated_at", "2019-04-08 10:39:37.108731"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (2.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:37.127801"], ["updated_at", "2019-04-08 10:39:37.127801"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.1ms) ROLLBACK  (1.4ms) BEGIN MultiApplicationsAccount Load (2.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:37.150357"], ["updated_at", "2019-04-08 10:39:37.150357"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.160938"], ["updated_at", "2019-04-08 10:39:37.160938"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:37.173594"], ["updated_at", "2019-04-08 10:39:37.173594"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (3.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.190548"], ["updated_at", "2019-04-08 10:39:37.190548"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.1ms) BEGIN MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:39:37.206558"], ["updated_at", "2019-04-08 10:39:37.206558"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.214532"], ["updated_at", "2019-04-08 10:39:37.214532"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.225977"], ["updated_at", "2019-04-08 10:39:37.225977"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.233074"], ["updated_at", "2019-04-08 10:39:37.233074"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1968], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:37.241254"], ["id", 1968]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.3ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.256207"], ["updated_at", "2019-04-08 10:39:37.256207"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.262498"], ["updated_at", "2019-04-08 10:39:37.262498"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1970], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:37.269465"], ["id", 1970]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1970], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.279443"], ["updated_at", "2019-04-08 10:39:37.279443"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.290849"], ["updated_at", "2019-04-08 10:39:37.290849"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1972], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:37.303295"], ["id", 1972]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1972], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.319153"], ["updated_at", "2019-04-08 10:39:37.319153"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.334310"], ["updated_at", "2019-04-08 10:39:37.334310"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.349363"], ["updated_at", "2019-04-08 10:39:37.349363"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.2ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.391285"], ["updated_at", "2019-04-08 10:39:37.391285"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.400346"], ["updated_at", "2019-04-08 10:39:37.400346"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.439464"], ["updated_at", "2019-04-08 10:39:37.439464"], ["synced_id", 123], ["host", "example.host"]]  (2.7ms) RELEASE SAVEPOINT active_record_1  (2.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.450081"], ["updated_at", "2019-04-08 10:39:37.450081"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:37.460477"], ["updated_at", "2019-04-08 10:39:37.460477"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (2.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.518800"], ["updated_at", "2019-04-08 10:39:37.518800"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:37.530950"], ["updated_at", "2019-04-08 10:39:37.530950"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806377"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:37.539381"], ["updated_at", "2019-04-08 10:39:37.539381"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633577"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1776], ["LIMIT", 1]] Account Update (2.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-08 10:39:37.561975"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1776]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (2.2ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.578386"], ["updated_at", "2019-04-08 10:39:37.578386"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1777], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1777], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:39:37.584873"], ["id", 1777]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1777], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:39:37.598095"], ["updated_at", "2019-04-08 10:39:37.598095"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.9ms) ROLLBACK  (1.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.615619"], ["updated_at", "2019-04-08 10:39:37.615619"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.621486"], ["updated_at", "2019-04-08 10:39:37.621486"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1779], ["LIMIT", 1]] Account Update (3.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:37.632807"], ["id", 1779]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.649332"], ["updated_at", "2019-04-08 10:39:37.649332"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.654722"], ["updated_at", "2019-04-08 10:39:37.654722"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1781], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:37.662550"], ["id", 1781]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1781], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.672637"], ["updated_at", "2019-04-08 10:39:37.672637"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.678453"], ["updated_at", "2019-04-08 10:39:37.678453"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1783], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:37.684985"], ["id", 1783]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1783], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.695778"], ["updated_at", "2019-04-08 10:39:37.695778"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.700335"], ["updated_at", "2019-04-08 10:39:37.700335"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1785], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:39:37.706411"], ["id", 1785]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.715039"], ["updated_at", "2019-04-08 10:39:37.715039"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:37.725252"], ["updated_at", "2019-04-08 10:39:37.725252"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.2ms) RELEASE SAVEPOINT active_record_1  (2.6ms) SELECT COUNT(*) FROM "accounts"  (1.3ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.742869"], ["updated_at", "2019-04-08 10:39:37.742869"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:37.750762"], ["updated_at", "2019-04-08 10:39:37.750762"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.760571"], ["updated_at", "2019-04-08 10:39:37.760571"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:37.767633"], ["updated_at", "2019-04-08 10:39:37.767633"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:39:37.775806"], ["updated_at", "2019-04-08 10:39:37.775806"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:39:37.783053"], ["updated_at", "2019-04-08 10:39:37.783053"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (2.2ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:37.799748"], ["updated_at", "2019-04-08 10:39:37.799748"], ["synced_id", 123]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:37.813004"], ["updated_at", "2019-04-08 10:39:37.813004"], ["synced_id", 1]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:37.817162"], ["updated_at", "2019-04-08 10:39:37.817162"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:37.820905"], ["updated_at", "2019-04-08 10:39:37.820905"], ["synced_id", 3]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (1.1ms) BEGIN Account Load (1.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Create (4.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:39:37.842969"], ["updated_at", "2019-04-08 10:39:37.842969"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Update (1.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:39:37.854013"], ["synced_id", 0], ["id", 1798]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:37.871160"], ["updated_at", "2019-04-08 10:39:37.871160"], ["synced_id", 123]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (2.9ms) ROLLBACK  (3.5ms) BEGIN  (3.3ms) SAVEPOINT active_record_1 Account Exists (4.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:39:37.900711"], ["updated_at", "2019-04-08 10:39:37.900711"], ["synced_id", 123]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (4.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.952070"], ["updated_at", "2019-04-08 10:39:37.952070"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (2.1ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:37.988029"], ["updated_at", "2019-04-08 10:39:37.988029"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:38.017420"], ["updated_at", "2019-04-08 10:39:38.017420"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:38.052301"], ["updated_at", "2019-04-08 10:39:38.052301"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:38.079525"], ["updated_at", "2019-04-08 10:39:38.079525"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:39:38.098313"], ["updated_at", "2019-04-08 10:39:38.098313"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.5ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.434094"], ["updated_at", "2019-04-08 10:41:50.434094"], ["synced_id", 123], ["host", "example.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.439112"], ["updated_at", "2019-04-08 10:41:50.439112"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:41:50.465800"], ["updated_at", "2019-04-08 10:41:50.465800"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.497939"], ["updated_at", "2019-04-08 10:41:50.497939"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.511984"], ["updated_at", "2019-04-08 10:41:50.511984"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.542300"], ["updated_at", "2019-04-08 10:41:50.542300"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.563828"], ["updated_at", "2019-04-08 10:41:50.563828"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.578143"], ["updated_at", "2019-04-08 10:41:50.578143"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (2.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.605384"], ["updated_at", "2019-04-08 10:41:50.605384"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.623317"], ["updated_at", "2019-04-08 10:41:50.623317"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:41:50.662342"], ["updated_at", "2019-04-08 10:41:50.662342"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.677415"], ["updated_at", "2019-04-08 10:41:50.677415"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.685095"], ["updated_at", "2019-04-08 10:41:50.685095"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.691614"], ["updated_at", "2019-04-08 10:41:50.691614"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.701383"], ["updated_at", "2019-04-08 10:41:50.701383"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.714520"], ["updated_at", "2019-04-08 10:41:50.714520"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.718481"], ["updated_at", "2019-04-08 10:41:50.718481"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1985], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:41:50.724603"], ["id", 1985]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.733289"], ["updated_at", "2019-04-08 10:41:50.733289"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.737281"], ["updated_at", "2019-04-08 10:41:50.737281"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1987], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:41:50.743345"], ["id", 1987]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1987], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.752784"], ["updated_at", "2019-04-08 10:41:50.752784"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.756830"], ["updated_at", "2019-04-08 10:41:50.756830"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1989], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:41:50.763139"], ["id", 1989]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1989], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.4ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.771512"], ["updated_at", "2019-04-08 10:41:50.771512"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.775711"], ["updated_at", "2019-04-08 10:41:50.775711"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:41:50.782098"], ["updated_at", "2019-04-08 10:41:50.782098"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:41:50.790759"], ["updated_at", "2019-04-08 10:41:50.790759"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.795538"], ["updated_at", "2019-04-08 10:41:50.795538"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:41:50.803998"], ["updated_at", "2019-04-08 10:41:50.803998"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.807772"], ["updated_at", "2019-04-08 10:41:50.807772"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:41:50.816115"], ["updated_at", "2019-04-08 10:41:50.816115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.820270"], ["updated_at", "2019-04-08 10:41:50.820270"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.828538"], ["updated_at", "2019-04-08 10:41:50.828538"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.834224"], ["updated_at", "2019-04-08 10:41:50.834224"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.844940"], ["updated_at", "2019-04-08 10:41:50.844940"], ["synced_id", 1], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.857659"], ["updated_at", "2019-04-08 10:41:50.857659"], ["synced_id", 2], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.864269"], ["updated_at", "2019-04-08 10:41:50.864269"], ["synced_id", 1], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.870509"], ["updated_at", "2019-04-08 10:41:50.870509"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:41:50.879854"], ["updated_at", "2019-04-08 10:41:50.879854"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633710"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:41:50.889311"], ["updated_at", "2019-04-08 10:41:50.889311"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806510"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:41:50.897250"], ["updated_at", "2019-04-08 10:41:50.897250"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2008], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2008], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:41:50.902839"], ["id", 2008]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2008], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.9ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.911614"], ["updated_at", "2019-04-08 10:41:50.911614"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.918929"], ["updated_at", "2019-04-08 10:41:50.918929"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:50.930170"], ["updated_at", "2019-04-08 10:41:50.930170"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.936672"], ["updated_at", "2019-04-08 10:41:50.936672"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:50.962371"], ["updated_at", "2019-04-08 10:41:50.962371"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:41:50.989998"], ["updated_at", "2019-04-08 10:41:50.989998"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 3.6ms)  (0.7ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:41:51.000974"], ["updated_at", "2019-04-08 10:41:51.000974"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 3.4ms)  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:41:51.013120"], ["updated_at", "2019-04-08 10:41:51.013120"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 3.5ms)  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:41:51.030841"], ["updated_at", "2019-04-08 10:41:51.030841"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 4.1ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.3ms | ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.061295"], ["updated_at", "2019-04-08 10:41:51.061295"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.065514"], ["updated_at", "2019-04-08 10:41:51.065514"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1806], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:41:51.072775"], ["id", 1806]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.081917"], ["updated_at", "2019-04-08 10:41:51.081917"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.085497"], ["updated_at", "2019-04-08 10:41:51.085497"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1808], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:41:51.090539"], ["id", 1808]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.096993"], ["updated_at", "2019-04-08 10:41:51.096993"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.100704"], ["updated_at", "2019-04-08 10:41:51.100704"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1810], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:41:51.105392"], ["id", 1810]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1810], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.113974"], ["updated_at", "2019-04-08 10:41:51.113974"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.117691"], ["updated_at", "2019-04-08 10:41:51.117691"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1812], ["LIMIT", 1]] Account Update (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:41:51.122272"], ["id", 1812]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1812], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.130663"], ["updated_at", "2019-04-08 10:41:51.130663"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:41:51.136291"], ["updated_at", "2019-04-08 10:41:51.136291"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.144390"], ["updated_at", "2019-04-08 10:41:51.144390"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:41:51.149510"], ["updated_at", "2019-04-08 10:41:51.149510"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.156195"], ["updated_at", "2019-04-08 10:41:51.156195"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:41:51.161877"], ["updated_at", "2019-04-08 10:41:51.161877"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:41:51.168535"], ["updated_at", "2019-04-08 10:41:51.168535"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:41:51.176805"], ["updated_at", "2019-04-08 10:41:51.176805"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:41:51.189353"], ["updated_at", "2019-04-08 10:41:51.189353"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:41:51.194165"], ["synced_id", 0], ["id", 1821]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:41:51.206761"], ["updated_at", "2019-04-08 10:41:51.206761"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:41:51.215969"], ["updated_at", "2019-04-08 10:41:51.215969"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:41:51.223408"], ["updated_at", "2019-04-08 10:41:51.223408"], ["synced_id", 1]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:41:51.228044"], ["updated_at", "2019-04-08 10:41:51.228044"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:41:51.232258"], ["updated_at", "2019-04-08 10:41:51.232258"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:41:51.242413"], ["updated_at", "2019-04-08 10:41:51.242413"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:41:51.254482"], ["updated_at", "2019-04-08 10:41:51.254482"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633711"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1827], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-08 10:41:51.273235"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1827]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:41:51.282595"], ["updated_at", "2019-04-08 10:41:51.282595"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806511"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:41:51.291907"], ["updated_at", "2019-04-08 10:41:51.291907"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:41:51.312029"], ["updated_at", "2019-04-08 10:41:51.312029"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1830], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1830], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:41:51.316883"], ["id", 1830]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1830], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.5ms) BEGIN  (0.5ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:43:02.896011"], ["updated_at", "2019-04-08 10:43:02.896011"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.6ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:02.945453"], ["updated_at", "2019-04-08 10:43:02.945453"], ["synced_id", 123], ["host", "example.host"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:02.953397"], ["updated_at", "2019-04-08 10:43:02.953397"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:43:02.972116"], ["updated_at", "2019-04-08 10:43:02.972116"], ["synced_id", 123]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (2.0ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:43:02.987579"], ["updated_at", "2019-04-08 10:43:02.987579"], ["synced_id", 123]]  (1.9ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (1.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (3.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:43:03.040654"], ["updated_at", "2019-04-08 10:43:03.040654"], ["synced_id", 1]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:43:03.053506"], ["updated_at", "2019-04-08 10:43:03.053506"], ["synced_id", 2]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (4.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:43:03.062170"], ["updated_at", "2019-04-08 10:43:03.062170"], ["synced_id", 3]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Account Load (3.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (4.3ms) ROLLBACK  (1.7ms) BEGIN  (1.8ms) ROLLBACK  (2.7ms) BEGIN  (3.6ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.116951"], ["updated_at", "2019-04-08 10:43:03.116951"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SELECT COUNT(*) FROM "accounts" Account Load (3.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.3ms) SAVEPOINT active_record_1 Account Exists (4.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:43:03.149459"], ["updated_at", "2019-04-08 10:43:03.149459"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (3.6ms) SELECT COUNT(*) FROM "accounts"  (3.5ms) ROLLBACK  (5.8ms) BEGIN  (3.2ms) SAVEPOINT active_record_1 Account Exists (4.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.198284"], ["updated_at", "2019-04-08 10:43:03.198284"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Account Load (2.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.2ms) SAVEPOINT active_record_1 Account Exists (2.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (4.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:43:03.219225"], ["updated_at", "2019-04-08 10:43:03.219225"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (3.2ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (3.1ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Account Exists (3.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.255542"], ["updated_at", "2019-04-08 10:43:03.255542"], ["provider", "bookingsync"], ["synced_id", 456]]  (3.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:43:03.277523"], ["updated_at", "2019-04-08 10:43:03.277523"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (3.9ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (3.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.305958"], ["updated_at", "2019-04-08 10:43:03.305958"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.9ms) SAVEPOINT active_record_1 Account Exists (5.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:43:03.324868"], ["updated_at", "2019-04-08 10:43:03.324868"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (2.1ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 Account Exists (3.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (3.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.361451"], ["updated_at", "2019-04-08 10:43:03.361451"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (3.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.383834"], ["updated_at", "2019-04-08 10:43:03.383834"], ["provider", "bookingsync"], ["synced_id", 123]]  (4.1ms) RELEASE SAVEPOINT active_record_1 Account Load (3.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (3.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1846], ["LIMIT", 1]] Account Update (3.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:43:03.412688"], ["id", 1846]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (2.2ms) BEGIN  (4.3ms) SAVEPOINT active_record_1 Account Exists (4.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.446281"], ["updated_at", "2019-04-08 10:43:03.446281"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.454901"], ["updated_at", "2019-04-08 10:43:03.454901"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (3.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (2.1ms) SAVEPOINT active_record_1 Account Exists (2.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1848], ["LIMIT", 1]] Account Update (2.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:43:03.473921"], ["id", 1848]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1848], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (2.1ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.497782"], ["updated_at", "2019-04-08 10:43:03.497782"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.504273"], ["updated_at", "2019-04-08 10:43:03.504273"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1850], ["LIMIT", 1]] Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:43:03.514502"], ["id", 1850]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1850], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.527644"], ["updated_at", "2019-04-08 10:43:03.527644"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.532568"], ["updated_at", "2019-04-08 10:43:03.532568"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1852], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:43:03.540195"], ["id", 1852]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.553648"], ["updated_at", "2019-04-08 10:43:03.553648"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1853], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1853], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:43:03.576089"], ["id", 1853]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1853], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-08 10:43:03.586775"], ["updated_at", "2019-04-08 10:43:03.586775"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:43:03.596558"], ["updated_at", "2019-04-08 10:43:03.596558"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-08 10:43:03.613149"], ["updated_at", "2019-04-08 10:43:03.613149"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-08 10:43:03.618271"], ["synced_id", 0], ["id", 1855]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:43:03.633795"], ["updated_at", "2019-04-08 10:43:03.633795"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806583"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:43:03.642367"], ["updated_at", "2019-04-08 10:43:03.642367"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633783"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1857], ["LIMIT", 1]] Account Update (1.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-08 10:43:03.664696"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1857]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:43:03.690452"], ["updated_at", "2019-04-08 10:43:03.690452"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554633783"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.707339"], ["updated_at", "2019-04-08 10:43:03.707339"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2017], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2019-04-08 10:43:03.726224"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2017]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-08 10:43:03.733549"], ["updated_at", "2019-04-08 10:43:03.733549"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554806583"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.739706"], ["updated_at", "2019-04-08 10:43:03.739706"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.748561"], ["updated_at", "2019-04-08 10:43:03.748561"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.752826"], ["updated_at", "2019-04-08 10:43:03.752826"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.762674"], ["updated_at", "2019-04-08 10:43:03.762674"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.767354"], ["updated_at", "2019-04-08 10:43:03.767354"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:43:03.775044"], ["updated_at", "2019-04-08 10:43:03.775044"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.6ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:43:03.785110"], ["updated_at", "2019-04-08 10:43:03.785110"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.789335"], ["updated_at", "2019-04-08 10:43:03.789335"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:43:03.798888"], ["updated_at", "2019-04-08 10:43:03.798888"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.803337"], ["updated_at", "2019-04-08 10:43:03.803337"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:43:03.811485"], ["updated_at", "2019-04-08 10:43:03.811485"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.815942"], ["updated_at", "2019-04-08 10:43:03.815942"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.823361"], ["updated_at", "2019-04-08 10:43:03.823361"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.827720"], ["updated_at", "2019-04-08 10:43:03.827720"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2030], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:43:03.833879"], ["id", 2030]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.841283"], ["updated_at", "2019-04-08 10:43:03.841283"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.845968"], ["updated_at", "2019-04-08 10:43:03.845968"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2032], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:43:03.851628"], ["id", 2032]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2032], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.860996"], ["updated_at", "2019-04-08 10:43:03.860996"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.865780"], ["updated_at", "2019-04-08 10:43:03.865780"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (2.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2034], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-08 10:43:03.882355"], ["id", 2034]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2034], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.895749"], ["updated_at", "2019-04-08 10:43:03.895749"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (3.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (2.9ms) BEGIN  (4.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:43:03.948282"], ["updated_at", "2019-04-08 10:43:03.948282"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (4.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:03.970986"], ["updated_at", "2019-04-08 10:43:03.970986"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:03.990517"], ["updated_at", "2019-04-08 10:43:03.990517"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (3.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (3.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.004548"], ["updated_at", "2019-04-08 10:43:04.004548"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.3ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.022905"], ["updated_at", "2019-04-08 10:43:04.022905"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (2.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:04.038870"], ["updated_at", "2019-04-08 10:43:04.038870"], ["synced_id", 123], ["host", "test.example"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.049762"], ["updated_at", "2019-04-08 10:43:04.049762"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (2.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:04.084884"], ["updated_at", "2019-04-08 10:43:04.084884"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.092734"], ["updated_at", "2019-04-08 10:43:04.092734"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-08 10:43:04.104416"], ["updated_at", "2019-04-08 10:43:04.104416"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2041], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2041], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-08 10:43:04.113401"], ["id", 2041]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2041], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:04.124968"], ["updated_at", "2019-04-08 10:43:04.124968"], ["synced_id", 1], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:04.129427"], ["updated_at", "2019-04-08 10:43:04.129427"], ["synced_id", 2], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:04.133644"], ["updated_at", "2019-04-08 10:43:04.133644"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-08 10:43:04.137781"], ["updated_at", "2019-04-08 10:43:04.137781"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.6ms) ROLLBACK  (2.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:43:04.182053"], ["updated_at", "2019-04-08 10:43:04.182053"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 11ms (ActiveRecord: 6.4ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:43:04.198462"], ["updated_at", "2019-04-08 10:43:04.198462"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10ms (ActiveRecord: 5.7ms)  (1.6ms) ROLLBACK  (1.3ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-08 10:43:04.222821"], ["updated_at", "2019-04-08 10:43:04.222821"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (3.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 9.1ms)  (3.5ms) SELECT COUNT(*) FROM "accounts" Account Load (3.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (2.3ms) ROLLBACK  (2.0ms) BEGIN  (3.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (3.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (3.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-08 10:43:04.286227"], ["updated_at", "2019-04-08 10:43:04.286227"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (3.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 30ms (ActiveRecord: 16.2ms)  (3.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (4.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (3.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (4.3ms) ROLLBACK  (2.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (2.7ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (3.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.371038"], ["updated_at", "2019-04-08 10:43:04.371038"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (2.7ms) ROLLBACK  (2.9ms) BEGIN  (3.0ms) SAVEPOINT active_record_1 Application Exists (3.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (2.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.413916"], ["updated_at", "2019-04-08 10:43:04.413916"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (2.4ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.463022"], ["updated_at", "2019-04-08 10:43:04.463022"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (2.0ms) BEGIN  (2.5ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.499377"], ["updated_at", "2019-04-08 10:43:04.499377"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.519805"], ["updated_at", "2019-04-08 10:43:04.519805"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.539075"], ["updated_at", "2019-04-08 10:43:04.539075"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-08 10:43:04.602609"], ["updated_at", "2019-04-08 10:43:04.602609"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 06:57:50.136652"], ["updated_at", "2019-04-09 06:57:50.136652"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554879470"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.154802"], ["updated_at", "2019-04-09 06:57:50.154802"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 06:57:50.173151"], ["updated_at", "2019-04-09 06:57:50.173151"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554706670"], ["host", "example.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Application Exists (2.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.185057"], ["updated_at", "2019-04-09 06:57:50.185057"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.213763"], ["updated_at", "2019-04-09 06:57:50.213763"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.219394"], ["updated_at", "2019-04-09 06:57:50.219394"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.228681"], ["updated_at", "2019-04-09 06:57:50.228681"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.241459"], ["updated_at", "2019-04-09 06:57:50.241459"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2051], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:57:50.249822"], ["id", 2051]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.259942"], ["updated_at", "2019-04-09 06:57:50.259942"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.264988"], ["updated_at", "2019-04-09 06:57:50.264988"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2053], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:57:50.274303"], ["id", 2053]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2053], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.285506"], ["updated_at", "2019-04-09 06:57:50.285506"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.290809"], ["updated_at", "2019-04-09 06:57:50.290809"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2055], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:57:50.296859"], ["id", 2055]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2055], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.306091"], ["updated_at", "2019-04-09 06:57:50.306091"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.311511"], ["updated_at", "2019-04-09 06:57:50.311511"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:57:50.323859"], ["updated_at", "2019-04-09 06:57:50.323859"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:57:50.337488"], ["updated_at", "2019-04-09 06:57:50.337488"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.343757"], ["updated_at", "2019-04-09 06:57:50.343757"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:57:50.355423"], ["updated_at", "2019-04-09 06:57:50.355423"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.360788"], ["updated_at", "2019-04-09 06:57:50.360788"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:57:50.371546"], ["updated_at", "2019-04-09 06:57:50.371546"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.377289"], ["updated_at", "2019-04-09 06:57:50.377289"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:57:50.386318"], ["updated_at", "2019-04-09 06:57:50.386318"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2066], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2066], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 06:57:50.397698"], ["id", 2066]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2066], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.408511"], ["updated_at", "2019-04-09 06:57:50.408511"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.415493"], ["updated_at", "2019-04-09 06:57:50.415493"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.424866"], ["updated_at", "2019-04-09 06:57:50.424866"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.431883"], ["updated_at", "2019-04-09 06:57:50.431883"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.439961"], ["updated_at", "2019-04-09 06:57:50.439961"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:57:50.449220"], ["updated_at", "2019-04-09 06:57:50.449220"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.458328"], ["updated_at", "2019-04-09 06:57:50.458328"], ["synced_id", 123], ["host", "test.example"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.464656"], ["updated_at", "2019-04-09 06:57:50.464656"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.492315"], ["updated_at", "2019-04-09 06:57:50.492315"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.510652"], ["updated_at", "2019-04-09 06:57:50.510652"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.534996"], ["updated_at", "2019-04-09 06:57:50.534996"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.541589"], ["updated_at", "2019-04-09 06:57:50.541589"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.546460"], ["updated_at", "2019-04-09 06:57:50.546460"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.551071"], ["updated_at", "2019-04-09 06:57:50.551071"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:57:50.573014"], ["updated_at", "2019-04-09 06:57:50.573014"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.4ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.595118"], ["updated_at", "2019-04-09 06:57:50.595118"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1862], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1862], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 06:57:50.601878"], ["id", 1862]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1862], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-09 06:57:50.614866"], ["updated_at", "2019-04-09 06:57:50.614866"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-09 06:57:50.619347"], ["synced_id", 0], ["id", 1863]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.632035"], ["updated_at", "2019-04-09 06:57:50.632035"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:57:50.645798"], ["updated_at", "2019-04-09 06:57:50.645798"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554879470"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:57:50.654505"], ["updated_at", "2019-04-09 06:57:50.654505"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554706670"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.675628"], ["updated_at", "2019-04-09 06:57:50.675628"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.679827"], ["updated_at", "2019-04-09 06:57:50.679827"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1868], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:57:50.686292"], ["id", 1868]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.694215"], ["updated_at", "2019-04-09 06:57:50.694215"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.698002"], ["updated_at", "2019-04-09 06:57:50.698002"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1870], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:57:50.704195"], ["id", 1870]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1870], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.712792"], ["updated_at", "2019-04-09 06:57:50.712792"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.716500"], ["updated_at", "2019-04-09 06:57:50.716500"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1872], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:57:50.723294"], ["id", 1872]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1872], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.5ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.731940"], ["updated_at", "2019-04-09 06:57:50.731940"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.737179"], ["updated_at", "2019-04-09 06:57:50.737179"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1874], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:57:50.744274"], ["id", 1874]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.752843"], ["updated_at", "2019-04-09 06:57:50.752843"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:57:50.760578"], ["updated_at", "2019-04-09 06:57:50.760578"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.770647"], ["updated_at", "2019-04-09 06:57:50.770647"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:57:50.780057"], ["updated_at", "2019-04-09 06:57:50.780057"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.788896"], ["updated_at", "2019-04-09 06:57:50.788896"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:57:50.795058"], ["updated_at", "2019-04-09 06:57:50.795058"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:50.802078"], ["updated_at", "2019-04-09 06:57:50.802078"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:57:50.807332"], ["updated_at", "2019-04-09 06:57:50.807332"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:57:50.815192"], ["updated_at", "2019-04-09 06:57:50.815192"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:57:50.824193"], ["updated_at", "2019-04-09 06:57:50.824193"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:57:50.850611"], ["updated_at", "2019-04-09 06:57:50.850611"], ["synced_id", 1]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:57:50.856712"], ["updated_at", "2019-04-09 06:57:50.856712"], ["synced_id", 2]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:57:50.861180"], ["updated_at", "2019-04-09 06:57:50.861180"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.926934"], ["updated_at", "2019-04-09 06:57:50.926934"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.944337"], ["updated_at", "2019-04-09 06:57:50.944337"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.971283"], ["updated_at", "2019-04-09 06:57:50.971283"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:50.993545"], ["updated_at", "2019-04-09 06:57:50.993545"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:51.015523"], ["updated_at", "2019-04-09 06:57:51.015523"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:51.032002"], ["updated_at", "2019-04-09 06:57:51.032002"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (1.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (1.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:57:51.098707"], ["updated_at", "2019-04-09 06:57:51.098707"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.4ms)  (0.9ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:57:51.111794"], ["updated_at", "2019-04-09 06:57:51.111794"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:57:51.127130"], ["updated_at", "2019-04-09 06:57:51.127130"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.2ms)  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:57:51.144893"], ["updated_at", "2019-04-09 06:57:51.144893"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 3.2ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:51.156493"], ["updated_at", "2019-04-09 06:57:51.156493"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:57:51.161722"], ["updated_at", "2019-04-09 06:57:51.161722"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:57:51.173367"], ["updated_at", "2019-04-09 06:57:51.173367"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (1.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:57:51.193890"], ["updated_at", "2019-04-09 06:57:51.193890"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (1.5ms) BEGIN  (1.9ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) ROLLBACK  (1.0ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 Application Exists (2.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:25.857604"], ["updated_at", "2019-04-09 06:58:25.857604"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (2.1ms) ROLLBACK  (1.4ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:25.899501"], ["updated_at", "2019-04-09 06:58:25.899501"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:25.924966"], ["updated_at", "2019-04-09 06:58:25.924966"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:25.954137"], ["updated_at", "2019-04-09 06:58:25.954137"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:25.970956"], ["updated_at", "2019-04-09 06:58:25.970956"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.002347"], ["updated_at", "2019-04-09 06:58:26.002347"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.029940"], ["updated_at", "2019-04-09 06:58:26.029940"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.060434"], ["updated_at", "2019-04-09 06:58:26.060434"], ["synced_id", 123], ["host", "test.example"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.069898"], ["updated_at", "2019-04-09 06:58:26.069898"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.106078"], ["updated_at", "2019-04-09 06:58:26.106078"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.112836"], ["updated_at", "2019-04-09 06:58:26.112836"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.119950"], ["updated_at", "2019-04-09 06:58:26.119950"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:58:26.129386"], ["updated_at", "2019-04-09 06:58:26.129386"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.145735"], ["updated_at", "2019-04-09 06:58:26.145735"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.159465"], ["updated_at", "2019-04-09 06:58:26.159465"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.164886"], ["updated_at", "2019-04-09 06:58:26.164886"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.170077"], ["updated_at", "2019-04-09 06:58:26.170077"], ["synced_id", 1], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.174480"], ["updated_at", "2019-04-09 06:58:26.174480"], ["synced_id", 2], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.186168"], ["updated_at", "2019-04-09 06:58:26.186168"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.193159"], ["updated_at", "2019-04-09 06:58:26.193159"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 06:58:26.206010"], ["updated_at", "2019-04-09 06:58:26.206010"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554879506"], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.214300"], ["updated_at", "2019-04-09 06:58:26.214300"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 06:58:26.224369"], ["updated_at", "2019-04-09 06:58:26.224369"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554706706"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.231927"], ["updated_at", "2019-04-09 06:58:26.231927"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2088], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2019-04-09 06:58:26.251953"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2088]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.261591"], ["updated_at", "2019-04-09 06:58:26.261591"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.266699"], ["updated_at", "2019-04-09 06:58:26.266699"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:58:26.276397"], ["updated_at", "2019-04-09 06:58:26.276397"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:58:26.289234"], ["updated_at", "2019-04-09 06:58:26.289234"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.296135"], ["updated_at", "2019-04-09 06:58:26.296135"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:58:26.305396"], ["updated_at", "2019-04-09 06:58:26.305396"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.310093"], ["updated_at", "2019-04-09 06:58:26.310093"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:58:26.319521"], ["updated_at", "2019-04-09 06:58:26.319521"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.324094"], ["updated_at", "2019-04-09 06:58:26.324094"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.334847"], ["updated_at", "2019-04-09 06:58:26.334847"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.340797"], ["updated_at", "2019-04-09 06:58:26.340797"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2098], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:58:26.347330"], ["id", 2098]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.355231"], ["updated_at", "2019-04-09 06:58:26.355231"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.360213"], ["updated_at", "2019-04-09 06:58:26.360213"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2100], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:58:26.366458"], ["id", 2100]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2100], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.375872"], ["updated_at", "2019-04-09 06:58:26.375872"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.380417"], ["updated_at", "2019-04-09 06:58:26.380417"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2102], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:58:26.387177"], ["id", 2102]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2102], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.397589"], ["updated_at", "2019-04-09 06:58:26.397589"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.403337"], ["updated_at", "2019-04-09 06:58:26.403337"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (4.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.424335"], ["updated_at", "2019-04-09 06:58:26.424335"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:58:26.440042"], ["updated_at", "2019-04-09 06:58:26.440042"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2107], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2107], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.7ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 06:58:26.445379"], ["id", 2107]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2107], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.484578"], ["updated_at", "2019-04-09 06:58:26.484578"], ["synced_id", 123], ["host", "example.host"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.488722"], ["updated_at", "2019-04-09 06:58:26.488722"], ["synced_id", 123], ["host", "test.host"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:58:26.510280"], ["updated_at", "2019-04-09 06:58:26.510280"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:58:26.525112"], ["updated_at", "2019-04-09 06:58:26.525112"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554879506"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 06:58:26.532080"], ["updated_at", "2019-04-09 06:58:26.532080"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554706706"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1894], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-09 06:58:26.549573"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1894]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:58:26.556803"], ["updated_at", "2019-04-09 06:58:26.556803"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:58:26.560513"], ["updated_at", "2019-04-09 06:58:26.560513"], ["synced_id", 2]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:58:26.563932"], ["updated_at", "2019-04-09 06:58:26.563932"], ["synced_id", 3]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.574247"], ["updated_at", "2019-04-09 06:58:26.574247"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:58:26.581757"], ["updated_at", "2019-04-09 06:58:26.581757"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.593379"], ["updated_at", "2019-04-09 06:58:26.593379"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:58:26.599408"], ["updated_at", "2019-04-09 06:58:26.599408"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.608250"], ["updated_at", "2019-04-09 06:58:26.608250"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:58:26.616636"], ["updated_at", "2019-04-09 06:58:26.616636"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.625878"], ["updated_at", "2019-04-09 06:58:26.625878"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:58:26.632228"], ["updated_at", "2019-04-09 06:58:26.632228"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.640132"], ["updated_at", "2019-04-09 06:58:26.640132"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.645840"], ["updated_at", "2019-04-09 06:58:26.645840"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1907], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:58:26.653001"], ["id", 1907]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.662043"], ["updated_at", "2019-04-09 06:58:26.662043"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.667132"], ["updated_at", "2019-04-09 06:58:26.667132"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1909], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:58:26.673398"], ["id", 1909]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.683186"], ["updated_at", "2019-04-09 06:58:26.683186"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.688464"], ["updated_at", "2019-04-09 06:58:26.688464"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1911], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:58:26.695428"], ["id", 1911]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1911], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.705933"], ["updated_at", "2019-04-09 06:58:26.705933"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 06:58:26.710641"], ["updated_at", "2019-04-09 06:58:26.710641"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1913], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 06:58:26.716784"], ["id", 1913]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1913], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-09 06:58:26.731242"], ["updated_at", "2019-04-09 06:58:26.731242"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-09 06:58:26.737580"], ["synced_id", 0], ["id", 1914]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:58:26.750506"], ["updated_at", "2019-04-09 06:58:26.750506"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (2.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.760831"], ["updated_at", "2019-04-09 06:58:26.760831"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:58:26.770935"], ["updated_at", "2019-04-09 06:58:26.770935"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 06:58:26.793924"], ["updated_at", "2019-04-09 06:58:26.793924"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1918], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1918], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 06:58:26.800790"], ["id", 1918]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1918], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 06:58:26.810249"], ["updated_at", "2019-04-09 06:58:26.810249"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 9ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (1.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:58:26.850893"], ["updated_at", "2019-04-09 06:58:26.850893"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.6ms)  (1.1ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:58:26.866828"], ["updated_at", "2019-04-09 06:58:26.866828"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.5ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 06:58:26.882963"], ["updated_at", "2019-04-09 06:58:26.882963"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.3ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 06:58:26.903135"], ["updated_at", "2019-04-09 06:58:26.903135"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 5.4ms)  (1.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 8ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (1.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (1.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:20:43.106613"], ["updated_at", "2019-04-09 07:20:43.106613"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 46ms (ActiveRecord: 18.7ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:20:43.121293"], ["updated_at", "2019-04-09 07:20:43.121293"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.5ms)  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (1.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:20:43.153770"], ["updated_at", "2019-04-09 07:20:43.153770"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 9.7ms)  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:20:43.176080"], ["updated_at", "2019-04-09 07:20:43.176080"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 4.8ms)  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.199818"], ["updated_at", "2019-04-09 07:20:43.199818"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:20:43.214432"], ["updated_at", "2019-04-09 07:20:43.214432"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2112], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2112], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 07:20:43.223616"], ["id", 2112]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2112], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 07:20:43.233960"], ["updated_at", "2019-04-09 07:20:43.233960"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554880843"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.241963"], ["updated_at", "2019-04-09 07:20:43.241963"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (2.2ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 07:20:43.253897"], ["updated_at", "2019-04-09 07:20:43.253897"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554708043"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.260844"], ["updated_at", "2019-04-09 07:20:43.260844"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2114], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2019-04-09 07:20:43.283432"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2114]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.290825"], ["updated_at", "2019-04-09 07:20:43.290825"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.297906"], ["updated_at", "2019-04-09 07:20:43.297906"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.305238"], ["updated_at", "2019-04-09 07:20:43.305238"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.317963"], ["updated_at", "2019-04-09 07:20:43.317963"], ["synced_id", 123], ["host", "test.example"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.7ms) SAVEPOINT active_record_1 Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.330335"], ["updated_at", "2019-04-09 07:20:43.330335"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.354167"], ["updated_at", "2019-04-09 07:20:43.354167"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.362672"], ["updated_at", "2019-04-09 07:20:43.362672"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.0ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:20:43.372493"], ["updated_at", "2019-04-09 07:20:43.372493"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.380711"], ["updated_at", "2019-04-09 07:20:43.380711"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.401611"], ["updated_at", "2019-04-09 07:20:43.401611"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.407001"], ["updated_at", "2019-04-09 07:20:43.407001"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:20:43.415207"], ["updated_at", "2019-04-09 07:20:43.415207"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (1.0ms) ROLLBACK  (0.9ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:20:43.426924"], ["updated_at", "2019-04-09 07:20:43.426924"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.431716"], ["updated_at", "2019-04-09 07:20:43.431716"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (2.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:20:43.443365"], ["updated_at", "2019-04-09 07:20:43.443365"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.448364"], ["updated_at", "2019-04-09 07:20:43.448364"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:20:43.458829"], ["updated_at", "2019-04-09 07:20:43.458829"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.463583"], ["updated_at", "2019-04-09 07:20:43.463583"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.471592"], ["updated_at", "2019-04-09 07:20:43.471592"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.476746"], ["updated_at", "2019-04-09 07:20:43.476746"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2129], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:20:43.482883"], ["id", 2129]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.493033"], ["updated_at", "2019-04-09 07:20:43.493033"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.497974"], ["updated_at", "2019-04-09 07:20:43.497974"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2131], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:20:43.504621"], ["id", 2131]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2131], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.514254"], ["updated_at", "2019-04-09 07:20:43.514254"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.518802"], ["updated_at", "2019-04-09 07:20:43.518802"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2133], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:20:43.525589"], ["id", 2133]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2133], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.537860"], ["updated_at", "2019-04-09 07:20:43.537860"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.543537"], ["updated_at", "2019-04-09 07:20:43.543537"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.554177"], ["updated_at", "2019-04-09 07:20:43.554177"], ["synced_id", 1], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.560692"], ["updated_at", "2019-04-09 07:20:43.560692"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.567068"], ["updated_at", "2019-04-09 07:20:43.567068"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.577550"], ["updated_at", "2019-04-09 07:20:43.577550"], ["synced_id", 2], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.592816"], ["updated_at", "2019-04-09 07:20:43.592816"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.609997"], ["updated_at", "2019-04-09 07:20:43.609997"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.635626"], ["updated_at", "2019-04-09 07:20:43.635626"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.659216"], ["updated_at", "2019-04-09 07:20:43.659216"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.675542"], ["updated_at", "2019-04-09 07:20:43.675542"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.699802"], ["updated_at", "2019-04-09 07:20:43.699802"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.716031"], ["updated_at", "2019-04-09 07:20:43.716031"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.721479"], ["updated_at", "2019-04-09 07:20:43.721479"], ["synced_id", 123], ["host", "test.host"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:20:43.732524"], ["updated_at", "2019-04-09 07:20:43.732524"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-09 07:20:43.755798"], ["updated_at", "2019-04-09 07:20:43.755798"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-09 07:20:43.760571"], ["synced_id", 0], ["id", 1927]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.7ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.772670"], ["updated_at", "2019-04-09 07:20:43.772670"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:20:43.781024"], ["updated_at", "2019-04-09 07:20:43.781024"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:20:43.803499"], ["updated_at", "2019-04-09 07:20:43.803499"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554880843"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:20:43.814291"], ["updated_at", "2019-04-09 07:20:43.814291"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554708043"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1931], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-09 07:20:43.833472"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1931]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:20:43.842085"], ["updated_at", "2019-04-09 07:20:43.842085"], ["synced_id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:20:43.846378"], ["updated_at", "2019-04-09 07:20:43.846378"], ["synced_id", 2]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:20:43.850932"], ["updated_at", "2019-04-09 07:20:43.850932"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:43.860656"], ["updated_at", "2019-04-09 07:20:43.860656"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1935], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1935], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 07:20:43.868079"], ["id", 1935]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1935], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:20:43.878147"], ["updated_at", "2019-04-09 07:20:43.878147"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:20:43.886756"], ["updated_at", "2019-04-09 07:20:43.886756"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.896600"], ["updated_at", "2019-04-09 07:20:43.896600"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:20:43.904665"], ["updated_at", "2019-04-09 07:20:43.904665"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.914390"], ["updated_at", "2019-04-09 07:20:43.914390"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:20:43.920887"], ["updated_at", "2019-04-09 07:20:43.920887"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.929600"], ["updated_at", "2019-04-09 07:20:43.929600"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:20:43.936210"], ["updated_at", "2019-04-09 07:20:43.936210"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.946793"], ["updated_at", "2019-04-09 07:20:43.946793"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:20:43.953392"], ["updated_at", "2019-04-09 07:20:43.953392"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.962757"], ["updated_at", "2019-04-09 07:20:43.962757"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.968065"], ["updated_at", "2019-04-09 07:20:43.968065"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1947], ["LIMIT", 1]] Account Update (1.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:20:43.974690"], ["id", 1947]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.983091"], ["updated_at", "2019-04-09 07:20:43.983091"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:43.988131"], ["updated_at", "2019-04-09 07:20:43.988131"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1949], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:20:43.994814"], ["id", 1949]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1949], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:44.004568"], ["updated_at", "2019-04-09 07:20:44.004568"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:44.009517"], ["updated_at", "2019-04-09 07:20:44.009517"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1951], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:20:44.017038"], ["id", 1951]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1951], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:44.026937"], ["updated_at", "2019-04-09 07:20:44.026937"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:20:44.031946"], ["updated_at", "2019-04-09 07:20:44.031946"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1953], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:20:44.038284"], ["id", 1953]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:20:44.110660"], ["updated_at", "2019-04-09 07:20:44.110660"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:23:57.226478"], ["updated_at", "2019-04-09 07:23:57.226478"], ["synced_id", 1]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:23:57.231925"], ["updated_at", "2019-04-09 07:23:57.231925"], ["synced_id", 2]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:23:57.236876"], ["updated_at", "2019-04-09 07:23:57.236876"], ["synced_id", 3]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:23:57.261898"], ["updated_at", "2019-04-09 07:23:57.261898"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554881037"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:23:57.277633"], ["updated_at", "2019-04-09 07:23:57.277633"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554708237"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1958], ["LIMIT", 1]] Account Update (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-04-09 07:23:57.310632"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1958]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.320915"], ["updated_at", "2019-04-09 07:23:57.320915"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.325279"], ["updated_at", "2019-04-09 07:23:57.325279"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1960], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:23:57.332499"], ["id", 1960]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.340431"], ["updated_at", "2019-04-09 07:23:57.340431"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.344630"], ["updated_at", "2019-04-09 07:23:57.344630"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1962], ["LIMIT", 1]] Account Update (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:23:57.351097"], ["id", 1962]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1962], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.360743"], ["updated_at", "2019-04-09 07:23:57.360743"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.366258"], ["updated_at", "2019-04-09 07:23:57.366258"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1964], ["LIMIT", 1]] Account Update (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:23:57.372358"], ["id", 1964]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1964], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.382350"], ["updated_at", "2019-04-09 07:23:57.382350"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.387202"], ["updated_at", "2019-04-09 07:23:57.387202"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1966], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:23:57.393880"], ["id", 1966]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.402303"], ["updated_at", "2019-04-09 07:23:57.402303"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:23:57.412538"], ["updated_at", "2019-04-09 07:23:57.412538"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "accounts"  (1.3ms) ROLLBACK  (1.3ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.427085"], ["updated_at", "2019-04-09 07:23:57.427085"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:23:57.435618"], ["updated_at", "2019-04-09 07:23:57.435618"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.445912"], ["updated_at", "2019-04-09 07:23:57.445912"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:23:57.454136"], ["updated_at", "2019-04-09 07:23:57.454136"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.464090"], ["updated_at", "2019-04-09 07:23:57.464090"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:23:57.473347"], ["updated_at", "2019-04-09 07:23:57.473347"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:23:57.494149"], ["updated_at", "2019-04-09 07:23:57.494149"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:23:57.504761"], ["updated_at", "2019-04-09 07:23:57.504761"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.9ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.516357"], ["updated_at", "2019-04-09 07:23:57.516357"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1977], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1977], ["LIMIT", 1]] Account Update (1.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 07:23:57.528719"], ["id", 1977]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1977], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:23:57.540560"], ["updated_at", "2019-04-09 07:23:57.540560"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.7ms) ROLLBACK  (0.8ms) BEGIN Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-04-09 07:23:57.572304"], ["updated_at", "2019-04-09 07:23:57.572304"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-04-09 07:23:57.576506"], ["synced_id", 0], ["id", 1979]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.598709"], ["updated_at", "2019-04-09 07:23:57.598709"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.8ms) BEGIN  (1.2ms) ROLLBACK  (0.9ms) BEGIN  (1.1ms) ROLLBACK  (0.8ms) BEGIN  (1.4ms) ROLLBACK  (1.0ms) BEGIN  (1.0ms) ROLLBACK  (1.6ms) BEGIN  (1.0ms) ROLLBACK  (1.0ms) BEGIN  (1.5ms) SAVEPOINT active_record_1 Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.667818"], ["updated_at", "2019-04-09 07:23:57.667818"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.698016"], ["updated_at", "2019-04-09 07:23:57.698016"], ["synced_id", 123], ["host", "test.example"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.706073"], ["updated_at", "2019-04-09 07:23:57.706073"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.713081"], ["updated_at", "2019-04-09 07:23:57.713081"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:23:57.722357"], ["updated_at", "2019-04-09 07:23:57.722357"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2144], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2144], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-04-09 07:23:57.729180"], ["id", 2144]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2144], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.738251"], ["updated_at", "2019-04-09 07:23:57.738251"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.742267"], ["updated_at", "2019-04-09 07:23:57.742267"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.752387"], ["updated_at", "2019-04-09 07:23:57.752387"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.761103"], ["updated_at", "2019-04-09 07:23:57.761103"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2147], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.2ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:23:57.770938"], ["id", 2147]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.779606"], ["updated_at", "2019-04-09 07:23:57.779606"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.784934"], ["updated_at", "2019-04-09 07:23:57.784934"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2149], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:23:57.791706"], ["id", 2149]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2149], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.800902"], ["updated_at", "2019-04-09 07:23:57.800902"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.805544"], ["updated_at", "2019-04-09 07:23:57.805544"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2151], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.8ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-04-09 07:23:57.811601"], ["id", 2151]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2151], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.820727"], ["updated_at", "2019-04-09 07:23:57.820727"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.824725"], ["updated_at", "2019-04-09 07:23:57.824725"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:23:57.832399"], ["updated_at", "2019-04-09 07:23:57.832399"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.7ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:23:57.843059"], ["updated_at", "2019-04-09 07:23:57.843059"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.847704"], ["updated_at", "2019-04-09 07:23:57.847704"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:23:57.858000"], ["updated_at", "2019-04-09 07:23:57.858000"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.862406"], ["updated_at", "2019-04-09 07:23:57.862406"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.7ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:23:57.871497"], ["updated_at", "2019-04-09 07:23:57.871497"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.876867"], ["updated_at", "2019-04-09 07:23:57.876867"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.8ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 07:23:57.885912"], ["updated_at", "2019-04-09 07:23:57.885912"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554881037"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.894601"], ["updated_at", "2019-04-09 07:23:57.894601"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-04-09 07:23:57.908067"], ["updated_at", "2019-04-09 07:23:57.908067"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1554708237"], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.918237"], ["updated_at", "2019-04-09 07:23:57.918237"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2163], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2019-04-09 07:23:57.940210"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2163]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.948766"], ["updated_at", "2019-04-09 07:23:57.948766"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.955434"], ["updated_at", "2019-04-09 07:23:57.955434"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:57.967567"], ["updated_at", "2019-04-09 07:23:57.967567"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-04-09 07:23:57.977213"], ["updated_at", "2019-04-09 07:23:57.977213"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (1.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.986616"], ["updated_at", "2019-04-09 07:23:57.986616"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.991563"], ["updated_at", "2019-04-09 07:23:57.991563"], ["synced_id", 2], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:57.996545"], ["updated_at", "2019-04-09 07:23:57.996545"], ["synced_id", 1], ["host", "example2.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:58.003065"], ["updated_at", "2019-04-09 07:23:58.003065"], ["synced_id", 2], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.013919"], ["updated_at", "2019-04-09 07:23:58.013919"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:58.035235"], ["updated_at", "2019-04-09 07:23:58.035235"], ["synced_id", 123], ["host", "test.example"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.042855"], ["updated_at", "2019-04-09 07:23:58.042855"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.8ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.9ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 7ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:23:58.134564"], ["updated_at", "2019-04-09 07:23:58.134564"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 6.2ms)  (1.2ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:23:58.150062"], ["updated_at", "2019-04-09 07:23:58.150062"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.5ms)  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-04-09 07:23:58.165071"], ["updated_at", "2019-04-09 07:23:58.165071"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 5.1ms)  (1.1ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.8ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-04-09 07:23:58.185746"], ["updated_at", "2019-04-09 07:23:58.185746"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 5.6ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.9ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) ROLLBACK  (1.1ms) BEGIN  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-04-09 07:23:58.224634"], ["updated_at", "2019-04-09 07:23:58.224634"], ["synced_id", 123]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:58.237972"], ["updated_at", "2019-04-09 07:23:58.237972"], ["synced_id", 123], ["host", "example.host"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-04-09 07:23:58.243521"], ["updated_at", "2019-04-09 07:23:58.243521"], ["synced_id", 123], ["host", "test.host"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.9ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.259042"], ["updated_at", "2019-04-09 07:23:58.259042"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.4ms) ROLLBACK  (1.3ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.288138"], ["updated_at", "2019-04-09 07:23:58.288138"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.9ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.7ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.318915"], ["updated_at", "2019-04-09 07:23:58.318915"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.6ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.342015"], ["updated_at", "2019-04-09 07:23:58.342015"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.7ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.356634"], ["updated_at", "2019-04-09 07:23:58.356634"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (1.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-04-09 07:23:58.384126"], ["updated_at", "2019-04-09 07:23:58.384126"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK